diff --git a/README.md b/README.md index 7773cfd0..4a93077e 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,19 @@ Bower and NPM packages are coming soon so right now (*which means around Sept. 2 >demo : `index_StepWay_As_module` in `dist` directory. +####Inject easy form generator in your app + +Just inject `eda.easyformGen.stepway` in you application : + +```javascript +angular + .module('YOUR_APP', [ + 'eda.easyformGen.stepway' //injects easy form generator-step way + ]) + +``` + + ####All easy form generator just by this small html : ```html diff --git a/dist/index_StepWay_As_Module.html b/dist/index_StepWay_As_Module.html index b7a28fbd..6815083f 100644 --- a/dist/index_StepWay_As_Module.html +++ b/dist/index_StepWay_As_Module.html @@ -80,7 +80,7 @@ 'use strict'; angular .module('appDemo', [ - 'ngwfApp' //injects easy form generator + 'eda.easyformGen.stepway' //injects easy form generator-step way ]) .controller('demoController', demoController); diff --git a/dist/public/js/eda.stepway.js b/dist/public/js/eda.stepway.js index bc74d2e8..148790b9 100644 --- a/dist/public/js/eda.stepway.js +++ b/dist/public/js/eda.stepway.js @@ -1,4 +1,4 @@ -!function(){"use strict";!function(){function e(e){function o(e){return e=e.replace(/[\-_\s]+(.)?/g,function(e,o){return o?o.toUpperCase():""}),e.replace(/^([A-Z])/,function(e,o){return o?o.toLowerCase():""})}e.setType({name:"richEditor",template:''}),e.setType({name:"blank",template:"
"});var l='

{{options.templateOptions.placeholder}}


';e.setType({name:"subTitle",template:l});var t='
  1. {{option.name}}
';e.setType({name:"basicSelect",template:t});var n='
  1. {{$group}} {{option.name}}
';e.setType({name:"groupedSelect",template:n});var i=["date-disabled","custom-class","show-weeks","starting-day","init-date","min-mode","max-mode","format-day","format-month","format-year","format-day-header","format-day-title","format-month-title","year-range","shortcut-propagation","datepicker-popup","show-button-bar","current-text","clear-text","close-text","close-on-date-selection","datepicker-append-to-body"],s=["datepicker-mode","min-date","max-date"],a={};angular.forEach(i,function(e){a[o(e)]={attribute:e}}),angular.forEach(s,function(e){a[o(e)]={bound:e}}),e.setType({name:"datepicker",template:'',wrapper:["bootstrapLabel","bootstrapHasError"],controller:["$scope",function(e){e.open=function(o){o.preventDefault(),o.stopPropagation(),e.opened=!0}}],defaultOptions:{ngModelAttrs:a,templateOptions:{addonLeft:{"class":"glyphicon glyphicon-calendar",onClick:function(e,o){e.templateOptions.isOpen=!e.templateOptions.isOpen}},onFocus:function(e,o,l){l.to.isOpen=!l.to.isOpen},datepickerOptions:{}}}}),e.setWrapper([{template:['
"," ",'
','
','
'," {{message(options.formControl.$viewValue, options.formControl.$modelValue, this)}}","
","
","
"].join(" ")}])}angular.module("ngwfApp",["ngwfApp.core","ngwfApp.controllers","ngwfApp.services","ngwfApp.filters","ngwfApp.directives"]).value("easyFormGenVersion","v1.0.8").config(e),e.$inject=["formlyConfigProvider"]}(),angular.module("ngwfApp").run(["$templateCache",function(e){e.put("edaStepWayEasyFormGeneratorTemplate.html",'

lines

layout

controls

save

Command

Add a new line : 

Visual

Command

– Selected line –

number of columns :

{{configuration.lines[configuration.activeLine -1].columns.length}}

Visual

Command

– Apply controls to columns –


  Click / Tap on column to open control selection.

  Select desired control and valid to apply it to column.

Visual

 Command



 Final Step : form preview

DATA MODEL

\n										{{vm.model | json}}\n									

FIELDS MODEL (ready to save to database one)

\n										{{vm.wfFormFieldsOnlyNeededProperties | json}}\n									

Easy form generator : {{easyFormGeneratorVERSION}} — Erwan DATIN (MacKentoch)
'),e.put("editModalTemplate.html",''); +!function(){"use strict";!function(){function e(e){function o(e){return e=e.replace(/[\-_\s]+(.)?/g,function(e,o){return o?o.toUpperCase():""}),e.replace(/^([A-Z])/,function(e,o){return o?o.toLowerCase():""})}e.setType({name:"richEditor",template:''}),e.setType({name:"blank",template:"
"});var l='

{{options.templateOptions.placeholder}}


';e.setType({name:"subTitle",template:l});var t='
  1. {{option.name}}
';e.setType({name:"basicSelect",template:t});var n='
  1. {{$group}} {{option.name}}
';e.setType({name:"groupedSelect",template:n});var i=["date-disabled","custom-class","show-weeks","starting-day","init-date","min-mode","max-mode","format-day","format-month","format-year","format-day-header","format-day-title","format-month-title","year-range","shortcut-propagation","datepicker-popup","show-button-bar","current-text","clear-text","close-text","close-on-date-selection","datepicker-append-to-body"],s=["datepicker-mode","min-date","max-date"],a={};angular.forEach(i,function(e){a[o(e)]={attribute:e}}),angular.forEach(s,function(e){a[o(e)]={bound:e}}),e.setType({name:"datepicker",template:'',wrapper:["bootstrapLabel","bootstrapHasError"],controller:["$scope",function(e){e.open=function(o){o.preventDefault(),o.stopPropagation(),e.opened=!0}}],defaultOptions:{ngModelAttrs:a,templateOptions:{addonLeft:{"class":"glyphicon glyphicon-calendar",onClick:function(e,o){e.templateOptions.isOpen=!e.templateOptions.isOpen}},onFocus:function(e,o,l){l.to.isOpen=!l.to.isOpen},datepickerOptions:{}}}}),e.setWrapper([{template:['
"," ",'
','
','
'," {{message(options.formControl.$viewValue, options.formControl.$modelValue, this)}}","
","
","
"].join(" ")}])}angular.module("eda.easyformGen.stepway",["ngwfApp"]),angular.module("ngwfApp",["ngwfApp.core","ngwfApp.controllers","ngwfApp.services","ngwfApp.filters","ngwfApp.directives"]).value("easyFormGenVersion","v1.0.8").config(e),e.$inject=["formlyConfigProvider"]}(),angular.module("ngwfApp").run(["$templateCache",function(e){e.put("edaStepWayEasyFormGeneratorTemplate.html",'

lines

layout

controls

save

Command

Add a new line : 

Visual

Command

– Selected line –

number of columns :

{{configuration.lines[configuration.activeLine -1].columns.length}}

Visual

Command

– Apply controls to columns –


  Click / Tap on column to open control selection.

  Select desired control and valid to apply it to column.

Visual

 Command



 Final Step : form preview

DATA MODEL

\n										{{vm.model | json}}\n									

FIELDS MODEL (ready to save to database one)

\n										{{vm.wfFormFieldsOnlyNeededProperties | json}}\n									

Easy form generator : {{easyFormGeneratorVERSION}} — Erwan DATIN (MacKentoch)
'),e.put("editModalTemplate.html",''); }]),function(){angular.module("ngwfApp.core",["textAngular","textAngularSetup","ngAnimate","toaster","formly","formlyBootstrap","ui.bootstrap","nya.bootstrap.select"])}(),function(){angular.module("ngwfApp.controllers",["ngwfApp.controllers.ngwfMainController","ngwfApp.controllers.ngwfWfEditController","ngwfApp.controllers.ngwfWfEditMODALController"])}(),function(){function e(e,o){e.FormNameAsTest="initial_name",o(function(){e.FormNameAsTest="name changed after 3s"},3e3)}angular.module("ngwfApp.controllers.ngwfMainController",[]).controller("ngwfMainController",e),e.$inject=["$scope","$timeout"]}(),function(){function e(e,o,l,t,n,i,s,a,r,c,d){function p(){return{showDebug:!1,configurationModelNumberofLines:1}}function u(){return{editTab:{active:!0},previewTab:{active:!1}}}function m(o){var l=JSON.parse(o.formlyField);e.configurationLoaded={},c.bindConfigurationLines(e.configurationLoaded,l),c.applyConfigurationToformlyModel(e.configurationLoaded,e.previewLoadedForm.fieldsModel,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields),e.previewLoadedForm.cancelButtonText=o.cancelButtonText,e.previewLoadedForm.submitButtonText=o.submitButtonText}function f(){i.pop({type:"info",timeout:2e3,title:"should save data model if it were not a static example",body:"data :"+t("json")(e.vm.model,4),showCloseButton:!0})}function v(){return{numColumn:-1,exist:!0,control:{type:"none",key:"none",subtype:"none"}}}function g(){return{line:-1,activeColumn:1,columns:[{numColumn:1,exist:!0,control:{type:"none",key:"none"}}]}}function y(){return e.configuration.activeLine=1,e.configuration.lines.length>1&&e.configuration.lines.splice(1,e.configuration.lines.length-2),e.countConfigurationModelLines()}function b(){return e.debug.configurationModelNumberofLines=e.configuration.lines.length,e.configuration.lines.length}function h(o){o<=e.countConfigurationModelLines()&&(e.configuration.activeLine=o)}function w(o){if(o>-1&&e.configuration.lines[o-1]){var l=e.configuration.lines[o];e.configuration.lines.splice(o,1),e.configuration.lines.splice(o-1,0,l),e.configuration.activeLine=1}c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields)}function x(o){if(o>-1&&e.configuration.lines[o+1]){var l=e.configuration.lines[o];e.configuration.lines.splice(o,1),e.configuration.lines.splice(o+1,0,l),e.configuration.activeLine=1}c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields)}function C(){e.configuration.lines.push({line:-1,activeColumn:1,columns:[{numColumn:1,exist:!0,control:{type:"none",key:"none"}}]}),c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields)}function S(o){o>-1&&(e.configuration.lines.length>1?(e.configuration.activeLine===o+1&&(e.configuration.activeLine=1),e.configuration.lines.splice(o,1)):s(function(){i.pop({type:"warning",title:"Last line",body:"Can't delete the last line",showCloseButton:!0})},100),c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields))}function T(){if(e.configuration.lines[e.configuration.activeLine-1].columns.length1&&e.configuration.lines[e.configuration.activeLine-1].columns.splice(e.configuration.lines[e.configuration.activeLine-1].columns.length-1,1),c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields)}function L(){e.configuration.configStepCounter=0}function k(){var o=e.configuration.listConfigStep.length-1;e.configuration.configStepCounter!==o&&e.configuration.configStepCounter++,N(e.configuration.configStepCounter)}function O(){0!==e.configuration.configStepCounter&&e.configuration.configStepCounter--,N(e.configuration.configStepCounter)}function R(o){return o=0;o--)e.configuration.stepIndicators[o]=!1}function N(o){D(),e.configuration.stepIndicators[o]=!0}e.vm=this,e.vm.model={},e.vm.wfFormFields=[],e.vm.wfFormFieldsOnlyNeededProperties=[],e.vm.onSubmit=f,e.easyFormGeneratorVERSION=l,e.debug=p(),e.tab=u(),e.configuration={},e.numberOfColumns=1,e.MaxNumberOfColumns=3,e.MinNumberOfColumns=1,e.columnTemplate=v(),e.lineTemplate=g(),e.resetToZeroModel=y,e.countConfigurationModelLines=b,e.setActiveLineNumber=h,e.upThisLine=w,e.downThisLine=x,e.addNewline=C,e.removeThisLine=S,e.increaseNumberOfColumns=T,e.decreaseNumberOfColumns=F,e.resetStepCounter=L,e.nextConfigStep=k,e.previousConfigStep=O,e.stepReachable=R,e.toggleAnimation=E,e.nyaSelect={},e.animationsEnabled=!0,e.showModalAddCtrlToColumn=P,e.loadExistingFormsList=q(),e.formlyList={},e.previewLoadedForm={fieldsModel:[]},e.configurationLoaded={},e.previewExistingform=m,e.saveThisForm=M,q(),c.initConfigurationEditFromScratch(e.configuration),d.initNyaSelect(e.nyaSelect)}angular.module("ngwfApp.controllers.ngwfWfEditController",[]).controller("ngwfWfEditController",e),e.$inject=["$scope","$templateCache","easyFormGenVersion","$filter","$anchorScroll","toaster","$timeout","$modal","$log","formFieldManage","controllerModalProxy"]}(),function(){function e(e,o,l,t,n,i,s){function a(){var o=i.addNewOptionRadio(e.radioRowCollection,e.newOptionRadio.saisie);o.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:o.details,body:"'"+e.newOptionRadio.saisie+"' cannot be added.",showCloseButton:!0}),e.newOptionRadio={saisie:""}}function r(o){var l=i.removeOption(e.radioRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Delete was cancelled.",showCloseButton:!0})}function c(o){var l=i.upthisOption(e.radioRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Operation cancelled.",showCloseButton:!0})}function d(o){var l=i.downthisOption(e.radioRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Operation cancelled.",showCloseButton:!0})}function p(){var o=i.addNewOptionBasicSelect(e.basicSelectRowCollection,e.newOptionBasicSelect.saisie);o.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:o.details,body:"'"+e.newOptionBasicSelect.saisie+"' cannot be added.",showCloseButton:!0}),e.newOptionBasicSelect={saisie:""}}function u(o){var l=i.removeOption(e.basicSelectRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Delete was cancelled.",showCloseButton:!0})}function m(o){var l=i.upthisOption(e.basicSelectRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Operation cancelled.",showCloseButton:!0})}function f(o){var l=i.downthisOption(e.basicSelectRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Operation cancelled.",showCloseButton:!0})}function v(){e.groupSelectGroupClick.showList=!e.groupSelectGroupClick.showList}function g(){if(""!==e.newGroupGroupedSelect.saisie){for(var o=e.GroupedSelectGroups.list.length-1;o>=0;o--)e.GroupedSelectGroups.list[o]===e.newGroupGroupedSelect.saisie&&t.pop({type:"warning",timeout:2e3,title:"Group already exists",body:"No group added.",showCloseButton:!0});e.GroupedSelectGroups.list.push(e.newGroupGroupedSelect.saisie)}else t.pop({type:"warning",timeout:2e3,title:"Not a valid group to add",body:"No group added.",showCloseButton:!0});e.newGroupGroupedSelect.saisie=""}function y(){var o=i.addNewOptionGroupedSelect(e.groupedSelectRowCollection,e.newOptionGroupedSelect.saisie,"");o.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:o.details,body:"'"+e.newOptionGroupedSelect.saisie+"' cannot be added.",showCloseButton:!0}),e.newOptionGroupedSelect={saisie:""}}function b(o){var l=i.removeOption(e.groupedSelectRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Delete was cancelled.",showCloseButton:!0})}function h(o){var l=i.upthisOption(e.groupedSelectRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Operation cancelled.",showCloseButton:!0})}function w(o){var l=i.downthisOption(e.groupedSelectRowCollection,o);l.resultFlag===!1&&t.pop({type:"warning",timeout:2e3,title:l.details,body:"Operation cancelled.",showCloseButton:!0})}function x(){e.demodt.dt=new Date}function C(){e.demodt.dt=null}function S(o){o.preventDefault(),o.stopPropagation(),e.demodt.opened=!0}function T(){return{formatYear:"yy",startingDay:1,showWeeks:!0,initDate:null}}function F(o){e.nyaSelect.selectedControl="none",$();for(var l=e.nyaSelect.controls.length-1;l>=0;l--)e.nyaSelect.controls[l].id===o&&(e.nyaSelect.selectedControl=e.nyaSelect.controls[l].id);"Date"===e.nyaSelect.selectedControl&&D()}function L(){"BasicSelect"===e.nyaSelect.selectedControl&&E(),"GroupedSelect"===e.nyaSelect.selectedControl&&M(),"Radio"===e.nyaSelect.selectedControl&&R(),s.applyConfigToSelectedControl(e.nyaSelect),o.close(e.nyaSelect)}function k(){o.dismiss("cancel")}function O(){if(e.nyaSelect.temporyConfig.formlyOptions.length>0)for(var o=0;o<=e.nyaSelect.temporyConfig.formlyOptions.length-1;o++){var l={option:e.nyaSelect.temporyConfig.formlyOptions[o].name,order:o,group:""};e.radioRowCollection.rows.push(l)}}function R(){var o=[];if(e.nyaSelect.temporyConfig.formlyOptions=o,e.radioRowCollection.rows.length>0)for(var l=0;l<=e.radioRowCollection.rows.length-1;l++){var t={name:e.radioRowCollection.rows[l].option,value:l,group:""};e.nyaSelect.temporyConfig.formlyOptions.push(t)}}function P(){if(e.nyaSelect.temporyConfig.formlyOptions.length>0)for(var o=0;o<=e.nyaSelect.temporyConfig.formlyOptions.length-1;o++){var l={option:e.nyaSelect.temporyConfig.formlyOptions[o].name,order:o,group:""};e.basicSelectRowCollection.rows.push(l)}}function E(){var o=[];if(e.nyaSelect.temporyConfig.formlyOptions=o,e.basicSelectRowCollection.rows.length>0)for(var l=0;l<=e.basicSelectRowCollection.rows.length-1;l++){var t={name:e.basicSelectRowCollection.rows[l].option,value:l,group:""};e.nyaSelect.temporyConfig.formlyOptions.push(t)}}function q(){if(e.nyaSelect.temporyConfig.formlyOptions.length>0){for(var o=0;o<=e.nyaSelect.temporyConfig.formlyOptions.length-1;o++){var l={option:e.nyaSelect.temporyConfig.formlyOptions[o].name,order:o,group:e.nyaSelect.temporyConfig.formlyOptions[o].group};e.groupedSelectRowCollection.rows.push(l)}var t=_.uniq(_.pluck(e.groupedSelectRowCollection.rows,"group"));angular.copy(t,e.GroupedSelectGroups.list)}}function M(){e.nyaSelect.temporyConfig.formlyOptions=[];for(var o=0;o<=e.groupedSelectRowCollection.rows.length-1;o++){var l={name:e.groupedSelectRowCollection.rows[o].option,value:o,group:e.groupedSelectRowCollection.rows[o].group};e.nyaSelect.temporyConfig.formlyOptions.push(l)}}function D(){e.nyaSelect.temporyConfig.datepickerPopup=e.demodt.formats[0]}function N(){if("none"!==l.selectedControl){for(var o=e.nyaSelect.controls.length-1;o>=0;o--)e.nyaSelect.controls[o].id===l.selectedControl&&(e.modelNyaSelect=l.controls[o]);"BasicSelect"===e.nyaSelect.selectedControl&&P(),"GroupedSelect"===e.nyaSelect.selectedControl&&q(),"Radio"===e.nyaSelect.selectedControl&&O()}}function $(){e.nyaSelect.temporyConfig={formlyLabel:"",formlyRequired:!1,formlyPlaceholder:"",formlyDesciption:"",formlyOptions:[]}}var A={rows:[]};e.radioRowCollection=A,e.newOptionRadio={saisie:""},e.addNewOptionRadio=a,e.removeRadioRow=r,e.upThisRadioRow=c,e.downThisRadioRow=d,e.basicSelectRowCollection=A,e.newOptionBasicSelect={saisie:""},e.addNewOptionBasicSelect=p,e.removeRow=u,e.upThisRow=m,e.downThisRow=f,e.groupedSelectRowCollection=A,e.newOptionGroupedSelect={saisie:""},e.GroupedSelectGroups={list:[]},e.newGroupGroupedSelect={saisie:""},e.groupSelectGroupClick={showList:!1},e.showGroupListToChoose=v,e.addNewGroupToGroupedSelect=g,e.addNewOptionGroupedSelect=y,e.removeGroupedSelectRow=b,e.upThisGroupedSelectRow=h,e.downThisGroupedSelectRow=w,e.demodt={},e.today=x,e.clear=C,e.open=S,e.dateOptions=T(),e.demodt.formats=["dd-MMMM-yyyy","yyyy/MM/dd","dd.MM.yyyy","shortDate"],e.nyaSelect=l,e.nyaSelect.selectedControl=e.nyaSelect.temporyConfig.selectedControl,e.selectThisControl=F,e.ok=L,e.cancel=k,x(),N()}angular.module("ngwfApp.controllers.ngwfWfEditMODALController",[]).controller("ngwfWfEditMODALController",e),e.$inject=["$scope","$modalInstance","nyaSelect","toaster","$timeout","selectOptionManage","controllerModalProxy"]}(),function(){function e(e,o,l,t){function n(e,o,n){function i(){var o=angular.isArray(e.edaEasyFormGeneratorModel.edaFieldsModel)&&e.edaEasyFormGeneratorModel.edaFieldsModel.length>0?e.edaEasyFormGeneratorModel.edaFieldsModel:s();return o}function s(){var e=[{line:1,activeColumn:1,columns:[{numColumn:1,exist:!0,control:{type:"none",key:"none"}}]}];return e}function a(){var o=angular.isArray(e.edaEasyFormGeneratorModel.dataModel)&&e.edaEasyFormGeneratorModel.dataModel.length>0?e.edaEasyFormGeneratorModel.dataModel:[];return o}function r(){return e.edaEasyFormGeneratorModel}function c(e,o){u()}function d(){return e.returnSaveEvent}function p(o,l){if(o===!0){var t={formName:e.configuration.formName,btnSubmitText:e.configuration.submitButtonText,btnCancelText:e.configuration.cancelButtonText,edaFieldsModel:e.configuration.lines,edaFieldsModelStringified:angular.toJson(e.configuration.lines),formlyFieldsModel:e.vm.wfFormFieldsOnlyNeededProperties,dataModel:e.vm.model};e.edaSaveFormEvent({edaEasyFormGeneratorModel:t}),e.returnSaveEvent=!1}}function u(){if(angular.isDefined(e.edaEasyFormGeneratorModel)){var o=i();e.configurationLoaded={},l.bindConfigurationLines(e.configurationLoaded,o),t.refreshControlFormlyExpressionProperties(e.configurationLoaded),t.refreshControlFormlyValidators(e.configurationLoaded),t.refreshControlFormlyValidation(e.configurationLoaded),e.configuration=angular.copy(e.configurationLoaded),l.applyConfigurationToformlyModel(e.configurationLoaded,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields),e.vm.model=a,e.configuration.formName=angular.isString(e.edaEasyFormGeneratorModel.formName)?e.edaEasyFormGeneratorModel.formName:"",e.configuration.submitButtonText=angular.isString(e.edaEasyFormGeneratorModel.btnSubmitText)?e.edaEasyFormGeneratorModel.btnSubmitText:"Submit",e.configuration.cancelButtonText=angular.isString(e.edaEasyFormGeneratorModel.btnCancelText)?e.edaEasyFormGeneratorModel.btnCancelText:"Cancel"}}e.$watch(r,c,!0),e.$watch(d,p)}function i(e,o,l,t,n,i,s,a,r,c,d){function p(){return{showDebug:!1,configurationModelNumberofLines:1}}function u(){return{editTab:{active:!0},previewTab:{active:!1}}}function m(o){var l=JSON.parse(o.formlyField);e.configurationLoaded={},c.bindConfigurationLines(e.configurationLoaded,l),c.applyConfigurationToformlyModel(e.configurationLoaded,e.previewLoadedForm.fieldsModel,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields),e.previewLoadedForm.cancelButtonText=o.cancelButtonText,e.previewLoadedForm.submitButtonText=o.submitButtonText}function f(){i.pop({type:"info",timeout:2e3,title:"should save data model if it were not a static example",body:"data :"+t("json")(e.vm.model,4),showCloseButton:!0})}function v(){return{numColumn:-1,exist:!0,control:{type:"none",key:"none",subtype:"none"}}}function g(){return{line:-1,activeColumn:1,columns:[{numColumn:1,exist:!0,control:{type:"none",key:"none"}}]}}function y(){return e.configuration.activeLine=1,e.configuration.lines.length>1&&e.configuration.lines.splice(1,e.configuration.lines.length-2),e.countConfigurationModelLines()}function b(){return e.debug.configurationModelNumberofLines=e.configuration.lines.length,e.configuration.lines.length}function h(o){o<=e.countConfigurationModelLines()&&(e.configuration.activeLine=o)}function w(o){if(o>-1&&e.configuration.lines[o-1]){var l=e.configuration.lines[o];e.configuration.lines.splice(o,1),e.configuration.lines.splice(o-1,0,l),e.configuration.activeLine=1}c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields)}function x(o){if(o>-1&&e.configuration.lines[o+1]){var l=e.configuration.lines[o];e.configuration.lines.splice(o,1),e.configuration.lines.splice(o+1,0,l),e.configuration.activeLine=1}c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields)}function C(){e.configuration.lines.push({line:-1,activeColumn:1,columns:[{numColumn:1,exist:!0,control:{type:"none",key:"none"}}]}),c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields)}function S(o){o>-1&&(e.configuration.lines.length>1?(e.configuration.activeLine===o+1&&(e.configuration.activeLine=1),e.configuration.lines.splice(o,1)):s(function(){i.pop({type:"warning",title:"Last line",body:"Can't delete the last line",showCloseButton:!0})},100),c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields))}function T(){if(e.configuration.lines[e.configuration.activeLine-1].columns.length1&&e.configuration.lines[e.configuration.activeLine-1].columns.splice(e.configuration.lines[e.configuration.activeLine-1].columns.length-1,1),c.applyConfigurationToformlyModel(e.configuration,e.vm.wfFormFields,e.vm.model),e.vm.wfFormFieldsOnlyNeededProperties=angular.copy(e.vm.wfFormFields)}function L(){e.configuration.configStepCounter=0}function k(){var o=e.configuration.listConfigStep.length-1;e.configuration.configStepCounter!==o&&e.configuration.configStepCounter++,D(e.configuration.configStepCounter)}function O(){0!==e.configuration.configStepCounter&&e.configuration.configStepCounter--,D(e.configuration.configStepCounter)}function R(o){return o=0;o--)e.configuration.stepIndicators[o]=!1}function D(o){M(),e.configuration.stepIndicators[o]=!0}e.vm=this,e.vm.model={},e.vm.wfFormFields=[],e.vm.wfFormFieldsOnlyNeededProperties=[],e.vm.onSubmit=f,e.easyFormGeneratorVERSION=l,e.debug=p(),e.tab=u(),e.configuration={},e.numberOfColumns=1,e.MaxNumberOfColumns=3,e.MinNumberOfColumns=1,e.columnTemplate=v(),e.lineTemplate=g(),e.resetToZeroModel=y,e.countConfigurationModelLines=b,e.setActiveLineNumber=h,e.upThisLine=w,e.downThisLine=x,e.addNewline=C,e.removeThisLine=S,e.increaseNumberOfColumns=T,e.decreaseNumberOfColumns=F,e.resetStepCounter=L,e.nextConfigStep=k,e.previousConfigStep=O,e.stepReachable=R,e.toggleAnimation=E,e.nyaSelect={},e.animationsEnabled=!0,e.showModalAddCtrlToColumn=P,e.formlyList={},e.previewLoadedForm={fieldsModel:[]},e.configurationLoaded={},e.previewExistingform=m,e.saveThisForm=q,e.returnSaveEvent=!1,c.initConfigurationEditFromScratch(e.configuration),d.initNyaSelect(e.nyaSelect)}i.$inject=["$scope","$templateCache","easyFormGenVersion","$filter","$anchorScroll","toaster","$timeout","$modal","$log","formFieldManage","controllerModalProxy"];var s={restrict:"E",scope:{edaEasyFormGeneratorModel:"=",edaSaveFormEvent:"&edaSaveFormEvent"},controller:i,controllerAs:"vm",replace:!1,templateUrl:"edaStepWayEasyFormGeneratorTemplate.html",link:n};return s}angular.module("ngwfApp.directives.edaStepWayEasyFormGenDirective",[]).directive("edaStepWayEasyFormGen",e),e.$inject=["$templateCache","$timeout","formFieldManage","controllerModalProxy"]}(),function(){angular.module("ngwfApp.directives",["ngwfApp.directives.ngwfStRatioDirective","ngwfApp.directives.edaStepWayEasyFormGenDirective"])}(),function(){function e(){function e(e,o,l){var t=+l.stRatio;o.css("width",t+"%")}var o={link:e};return o}angular.module("ngwfApp.directives.ngwfStRatioDirective",[]).directive("stRatio",e),e.$inject=[]}(),function(){function e(){function e(e){return c(e)}function o(){var e={};return c(e),e}function l(e){angular.isObject(e)&&angular.forEach(e.lines,function(e,l){angular.forEach(e.columns,function(e,l){var t=o();angular.forEach(t.controls,function(o,l){e.control.type===o.formlyType&&e.control.subtype===o.formlySubtype&&(e.control.formlyExpressionProperties=o.formlyExpressionProperties)})})})}function t(e){angular.isObject(e)&&angular.forEach(e.lines,function(e,l){angular.forEach(e.columns,function(e,l){var t=o();angular.forEach(t.controls,function(o,l){e.control.type===o.formlyType&&e.control.subtype===o.formlySubtype&&(e.control.formlyValidators=o.formlyValidators)})})})}function n(e){angular.isObject(e)&&angular.forEach(e.lines,function(e,l){angular.forEach(e.columns,function(e,l){var t=o();angular.forEach(t.controls,function(o,l){e.control.type===o.formlyType&&e.control.subtype===o.formlySubtype&&(e.control.formlyValidation=o.formlyValidation)})})})}function i(e,o,l,t){return c(e),"undefined"!=typeof o.lines[l].columns[t].control.templateOptions&&(e.temporyConfig.selectedControl="undefined"!=typeof o.lines[l].columns[t].control.selectedControl?o.lines[l].columns[t].control.selectedControl:"none",e.temporyConfig.formlyLabel="undefined"!=typeof o.lines[l].columns[t].control.templateOptions.label?o.lines[l].columns[t].control.templateOptions.label:"",e.temporyConfig.formlyRequired="undefined"!=typeof o.lines[l].columns[t].control.templateOptions.required?o.lines[l].columns[t].control.templateOptions.required:"",e.temporyConfig.formlyDesciption="undefined"!=typeof o.lines[l].columns[t].control.templateOptions.description?o.lines[l].columns[t].control.templateOptions.description:"",e.temporyConfig.formlyPlaceholder="undefined"!=typeof o.lines[l].columns[t].control.templateOptions.placeholder?o.lines[l].columns[t].control.templateOptions.placeholder:"",e.temporyConfig.formlyOptions="undefined"!=typeof o.lines[l].columns[t].control.templateOptions.options?o.lines[l].columns[t].control.templateOptions.options:"",e.temporyConfig.formlyExpressionProperties="undefined"!=typeof o.lines[l].columns[t].control.formlyExpressionProperties?angular.copy(o.lines[l].columns[t].control.formlyExpressionProperties):{},e.temporyConfig.formlyValidators="undefined"!=typeof o.lines[l].columns[t].control.formlyValidators?angular.copy(o.lines[l].columns[t].control.formlyValidators):{},e.temporyConfig.formlyValidation="undefined"!=typeof o.lines[l].columns[t].control.formlyValidation?angular.copy(o.lines[l].columns[t].control.formlyValidation):{},"Date"===e.temporyConfig.selectedControl&&(e.temporyConfig.datepickerPopup="undefined"!=typeof o.lines[l].columns[t].control.templateOptions.datepickerPopup?o.lines[l].columns[t].control.templateOptions.datepickerPopup:"")),e}function s(e,o,l,t){var n=d(l);t.lines[e].columns[o].control.selectedControl=n.selectedControl,t.lines[e].columns[o].control.type=n.formlyType,t.lines[e].columns[o].control.subtype=n.formlySubtype,t.lines[e].columns[o].control.templateOptions={label:"",required:!1,description:"",placeholder:"",options:[]},t.lines[e].columns[o].control.templateOptions.label=n.formlyLabel,t.lines[e].columns[o].control.templateOptions.required=n.formlyRequired,t.lines[e].columns[o].control.templateOptions.description=n.formlyDesciption,t.lines[e].columns[o].control.templateOptions.placeholder=n.formlyPlaceholder,t.lines[e].columns[o].control.templateOptions.options=n.formlyOptions,t.lines[e].columns[o].control.formlyExpressionProperties=angular.copy(n.formlyExpressionProperties),t.lines[e].columns[o].control.formlyValidators=angular.copy(n.formlyValidators),t.lines[e].columns[o].control.formlyValidation=angular.copy(n.formlyValidation),"datepicker"===t.lines[e].columns[o].control.type&&(t.lines[e].columns[o].control.templateOptions.datepickerPopup=n.datepickerPopup);var i=t.lines[e].columns[o].control.type+"-"+Date.now();p(i,t)===!0?t.lines[e].columns[o].control.key=i:(i=t.lines[e].columns[o].control.type+"-"+Date.now(),p(i,t)===!0?t.lines[e].columns[o].control.key=i:i=t.lines[e].columns[o].control.type+"-"+Date.now()),t.lines[e].columns[o].control.edited=!0}function a(e){for(var o=e.controls.length-1;o>=0;o--)e.controls[o].id===e.selectedControl&&(e.controls[o].formlyLabel=e.temporyConfig.formlyLabel,e.controls[o].formlyRequired=e.temporyConfig.formlyRequired,e.controls[o].formlyDesciption=e.temporyConfig.formlyDesciption,e.controls[o].formlyPlaceholder=e.temporyConfig.formlyPlaceholder,e.controls[o].formlyOptions=e.temporyConfig.formlyOptions,"Date"===e.controls[o].id&&(e.controls[o].datepickerPopup=e.temporyConfig.datepickerPopup))}function r(){return{formlyLabel:"",formlyRequired:!1,formlyPlaceholder:"",formlyDesciption:"",formlyOptions:[]}}function c(e){var o={controls:[{id:"empty",name:"no control",subtitle:"no control",group:"Blank",formlyType:"blank",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{}},{id:"Header",name:"Header",subtitle:"no control",group:"Decoration",formlyType:"header",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{}},{id:"Subtitle",name:"Subtitle",subtitle:"no control",group:"Decoration",formlyType:"subTitle",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{}},{id:"TextInput",name:"Text input",subtitle:"Text input",group:"input",formlyType:"input",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{messages:{required:function(e,o,l){var t="this Text input field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}},{id:"Password",name:"Password",subtitle:"Password",group:"input",formlyType:"input",formlySubtype:"password",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{messages:{required:function(e,o,l){var t="this Password field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}},{id:"Email",name:"Email",subtitle:"Email",group:"input",formlyType:"input",formlySubtype:"email",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{emailShape:{expression:function(e,o){var l=o||e;return/^[a-z]+[a-z0-9._]+@[a-z]+\.[a-z.]{2,5}$/.test(l)},message:"$viewValue + ' is not a valid email'"}},formlyValidation:{messages:{required:function(e,o,l){var t="this Email field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return l.to.required?n:void 0}}}},{id:"Date",name:"Date",subtitle:"Date",group:"input",formlyType:"datepicker",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],datepickerPopup:"dd-MMMM-yyyy",formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{messages:{required:function(e,o,l){var t="this Date field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}},{id:"Texarea",name:"Textarea",subtitle:"Textarea",group:"Textarea",formlyType:"textarea",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{messages:{required:function(e,o,l){var t="this Textarea field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}},{id:"RichTextEditor",name:"RichTextEditor",subtitle:"RichTextEditor",group:"Textarea",formlyType:"richEditor",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{messages:{required:function(e,o,l){var t="this RichTextEditor field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}},{id:"Radio",name:"Radio",subtitle:"Radio",options:[],group:"Radio",formlyType:"radio",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{messages:{required:function(e,o,l){var t="this Password field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}},{id:"Checkbox",name:"Checkbox",subtitle:"Checkbox",group:"Checkbox",formlyType:"checkbox",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{ messages:{required:function(e,o,l){var t="this Checkbox field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}},{id:"BasicSelect",name:"Basic select",subtitle:"Basic select",options:[],group:"Select",formlyType:"basicSelect",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{messages:{required:function(e,o,l){var t="this Basic select field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}},{id:"GroupedSelect",name:"Grouped Select",subtitle:"Grouped Select",options:[],group:"Select",formlyType:"groupedSelect",formlySubtype:"",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{messages:{required:function(e,o,l){var t="this Grouped Select field is required",n="undefined"!=typeof l.to.label&&""!==l.to.label?l.to.label+" is required":t;return n}}}}],selectedControl:"none",temporyConfig:{selectedControl:"none",formlyLabel:"label",formlyRequired:!1,formlyDesciption:"",formlyPlaceholder:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{}}};return angular.copy(o,e),!0}function d(e){for(var o={selectedControl:"none",formlyType:"none",formlySubtype:"none",formlyLabel:"",formlyRequired:!1,formlyDesciption:"",formlyPlaceholder:"",formlyOptions:[],formlyExpressionProperties:{},formlyValidators:{},formlyValidation:{}},l=e.controls.length-1;l>=0;l--)e.selectedControl===e.controls[l].id&&(o.selectedControl=e.selectedControl,o.formlyType=e.controls[l].formlyType,o.formlySubtype=e.controls[l].formlySubtype,o.formlyLabel=e.controls[l].formlyLabel,o.formlyRequired=e.controls[l].formlyRequired,o.formlyDesciption=e.controls[l].formlyDesciption,o.formlyPlaceholder=e.controls[l].formlyPlaceholder,o.formlyOptions=e.controls[l].formlyOptions,o.formlyExpressionProperties=angular.copy(e.controls[l].formlyExpressionProperties),o.formlyValidators=angular.copy(e.controls[l].formlyValidators),o.formlyValidation=angular.copy(e.controls[l].formlyValidation),"datepicker"===e.controls[l].formlyType&&(o.datepickerPopup=e.controls[l].datepickerPopup));return o}function p(e,o){for(var l=!0,t=o.lines.length-1;t>=0;t--)for(var n=o.lines[t].columns.length-1;n>=0;n--)o.lines[t].columns[n].control.key===e&&(l=!1);return l}var u={initNyaSelect:e,getNyASelectFromSelectedLineColumn:i,bindConfigurationModelFromModalReturn:s,applyConfigToSelectedControl:a,resetTemporyConfig:r,getControlsDefinition:o,refreshControlFormlyExpressionProperties:l,refreshControlFormlyValidators:t,refreshControlFormlyValidation:n};return u}angular.module("ngwfApp.services.ngwfEditCtrlControllerModalProxy",[]).factory("controllerModalProxy",e),e.$inject=[]}(),function(){function e(){function e(e){var o={activeLine:1,listConfigStep:["init","first","second","third"],stepIndicators:[!0,!1,!1,!1],configStepCounter:0,submitButtonText:"submit",cancelButtonText:"cancel",lines:[{line:1,activeColumn:1,columns:[{numColumn:1,exist:!0,control:{type:"none",key:"none"}}]}]};angular.copy(o,e)}function o(e,o){if("[object Array]"===Object.prototype.toString.call(o)){var l={activeLine:1,listConfigStep:["init","first","second","third"],stepIndicators:[!0,!1,!1,!1],configStepCounter:0,submitButtonText:"submit",cancelButtonText:"cancel",lines:[]};return l.lines=[].concat(o),angular.copy(l,e),x("configuration model is bound","lines are bound to configuration model.")}return w("lines is not an array","Checks lines type, it is not an array.")}function l(e,o,l){t(o),h(l);for(var i=e.lines.length,c=0;i>c;c++)1===e.lines[c].columns.length&&("header"===e.lines[c].columns[0].control.type?n(o,e,c):s(o,e,c)),2===e.lines[c].columns.length&&a(o,e,c),3===e.lines[c].columns.length&&r(o,e,c)}function t(e){var o=[];angular.copy(o,e)}function n(e,o,l){var t='

'+b(o.lines[l].columns[0].control)+"


";e.push({template:"undefined"!=typeof o.lines[l].columns[0].control.type&&"header"===o.lines[l].columns[0].control.type?t:"
"})}function i(e,o,l){e.templateOptions.datepickerPopup=d(o.lines[l].columns[0].control)}function s(e,o,l){var t={className:"col-xs-12",type:"undefined"!=typeof o.lines[l].columns[0].control.type?"none"===o.lines[l].columns[0].control.type?"blank":o.lines[l].columns[0].control.type:"blank",key:"undefined"!=typeof o.lines[l].columns[0].control.key?o.lines[l].columns[0].control.key:"blank"+Date.now(),templateOptions:{type:g(o.lines[l].columns[0].control),label:c(o.lines[l].columns[0].control),required:f(o.lines[l].columns[0].control),placeholder:y(o.lines[l].columns[0].control),description:b(o.lines[l].columns[0].control),options:v(o.lines[l].columns[0].control)},expressionProperties:p(o.lines[l].columns[0].control),validators:u(o.lines[l].columns[0].control),validation:m(o.lines[l].columns[0].control)};"datepicker"===o.lines[l].columns[0].control.type&&i(t,o,l),e.push(t)}function a(e,o,l){var t={className:"col-xs-6",template:'

'+b(o.lines[l].columns[0].control)+"


"},n={className:"col-xs-6",template:'

'+b(o.lines[l].columns[1].control)+"


"},s={className:"col-xs-6",type:"undefined"!=typeof o.lines[l].columns[0].control.type?"none"===o.lines[l].columns[0].control.type?"blank":o.lines[l].columns[0].control.type:"blank",key:"undefined"!=typeof o.lines[l].columns[0].control.key?o.lines[l].columns[0].control.key:"blank"+Date.now(),templateOptions:{type:g(o.lines[l].columns[0].control),label:c(o.lines[l].columns[0].control),required:f(o.lines[l].columns[0].control),placeholder:y(o.lines[l].columns[0].control),description:b(o.lines[l].columns[0].control),options:v(o.lines[l].columns[0].control)},expressionProperties:p(o.lines[l].columns[0].control),validators:u(o.lines[l].columns[0].control),validation:m(o.lines[l].columns[0].control)};"datepicker"===o.lines[l].columns[0].control.type&&i(s,o,l);var a={className:"col-xs-6",type:"undefined"!=typeof o.lines[l].columns[1].control.type?"none"===o.lines[l].columns[1].control.type?"blank":o.lines[l].columns[1].control.type:"blank",key:"undefined"!=typeof o.lines[l].columns[1].control.key?o.lines[l].columns[1].control.key:"blank"+Date.now(),templateOptions:{type:g(o.lines[l].columns[1].control),label:c(o.lines[l].columns[1].control),required:f(o.lines[l].columns[1].control),placeholder:y(o.lines[l].columns[1].control),description:b(o.lines[l].columns[1].control),options:v(o.lines[l].columns[1].control)},expressionProperties:p(o.lines[l].columns[1].control),validators:u(o.lines[l].columns[1].control),validation:m(o.lines[l].columns[1].control)};"datepicker"===o.lines[l].columns[1].control.type&&i(a,o,l);var r=[];r.push("header"===o.lines[l].columns[0].control.type?t:s),r.push("header"===o.lines[l].columns[1].control.type?n:a),e.push({className:"row",fieldGroup:r})}function r(e,o,l){var t={className:"col-xs-4",template:'

'+b(o.lines[l].columns[0].control)+"


"},n={className:"col-xs-4",template:'

'+b(o.lines[l].columns[1].control)+"


"},s={className:"col-xs-4",template:'

'+b(o.lines[l].columns[2].control)+"


"},a={className:"col-xs-4",type:"undefined"!=typeof o.lines[l].columns[0].control.type?"none"===o.lines[l].columns[0].control.type?"blank":o.lines[l].columns[0].control.type:"blank",key:"undefined"!=typeof o.lines[l].columns[0].control.key?o.lines[l].columns[0].control.key:"blank"+Date.now(),templateOptions:{type:g(o.lines[l].columns[0].control),label:c(o.lines[l].columns[0].control),required:f(o.lines[l].columns[0].control),placeholder:y(o.lines[l].columns[0].control),description:b(o.lines[l].columns[0].control),options:v(o.lines[l].columns[0].control)},expressionProperties:p(o.lines[l].columns[0].control),validators:u(o.lines[l].columns[0].control),validation:m(o.lines[l].columns[0].control)};"datepicker"===o.lines[l].columns[0].control.type&&i(a,o,l);var r={className:"col-xs-4",type:"undefined"!=typeof o.lines[l].columns[1].control.type?"none"===o.lines[l].columns[1].control.type?"blank":o.lines[l].columns[1].control.type:"blank",key:"undefined"!=typeof o.lines[l].columns[1].control.key?o.lines[l].columns[1].control.key:"blank"+Date.now(),templateOptions:{type:g(o.lines[l].columns[1].control),label:c(o.lines[l].columns[1].control),required:f(o.lines[l].columns[1].control),placeholder:y(o.lines[l].columns[1].control),description:b(o.lines[l].columns[1].control),options:v(o.lines[l].columns[1].control)},expressionProperties:p(o.lines[l].columns[1].control),validators:u(o.lines[l].columns[1].control),validation:m(o.lines[l].columns[1].control)};"datepicker"===o.lines[l].columns[1].control.type&&i(r,o,l);var d={className:"col-xs-4",type:"undefined"!=typeof o.lines[l].columns[2].control.type?"none"===o.lines[l].columns[2].control.type?"blank":o.lines[l].columns[2].control.type:"blank",key:"undefined"!=typeof o.lines[l].columns[2].control.key?o.lines[l].columns[2].control.key:"blank"+Date.now(),templateOptions:{type:g(o.lines[l].columns[2].control),label:c(o.lines[l].columns[2].control),required:f(o.lines[l].columns[2].control),placeholder:y(o.lines[l].columns[2].control),description:b(o.lines[l].columns[2].control),options:v(o.lines[l].columns[2].control)},expressionProperties:p(o.lines[l].columns[2].control),validators:u(o.lines[l].columns[2].control),validation:m(o.lines[l].columns[2].control)};"datepicker"===o.lines[l].columns[2].control.type&&i(d,o,l);var h=[];h.push("header"===o.lines[l].columns[0].control.type?t:a),h.push("header"===o.lines[l].columns[1].control.type?n:r),h.push("header"===o.lines[l].columns[2].control.type?s:d),e.push({className:"row",fieldGroup:h})}function c(e){return"undefined"!=typeof e.templateOptions&&"undefined"!=typeof e.templateOptions.label?e.templateOptions.label:""}function d(e){return"undefined"!=typeof e.templateOptions&&"undefined"!=typeof e.templateOptions.datepickerPopup?e.templateOptions.datepickerPopup:""}function p(e){return"undefined"!=typeof e.formlyExpressionProperties?angular.copy(e.formlyExpressionProperties):{}}function u(e){return"undefined"!=typeof e.formlyValidators?angular.copy(e.formlyValidators):{}}function m(e){return"undefined"!=typeof e.formlyValidation?angular.copy(e.formlyValidation):{}}function f(e){return"undefined"!=typeof e.templateOptions&&"undefined"!=typeof e.templateOptions.required?e.templateOptions.required:""}function v(e){return"undefined"!=typeof e.templateOptions&&"undefined"!=typeof e.templateOptions.options?e.templateOptions.options:""}function g(e){return"undefined"!=typeof e.subtype?e.subtype:""}function y(e){return"undefined"!=typeof e.templateOptions&&"undefined"!=typeof e.templateOptions.placeholder?e.templateOptions.placeholder:""}function b(e){return"undefined"!=typeof e.templateOptions&&"undefined"!=typeof e.templateOptions.description?e.templateOptions.description:""}function h(e){var o={};return angular.copy(o,e),!0}function w(e,o){var l={noError:!1,title:"",Message:""};return l.noError=!1,l.title=e,l.Message=o,l}function x(e,o){var l={noError:!1,title:"",Message:""};return l.noError=!0,l.title=e,l.Message=o,l}var C={initConfigurationEditFromScratch:e,bindConfigurationLines:o,applyConfigurationToformlyModel:l};return C}angular.module("ngwfApp.services.formFieldManage",[]).factory("formFieldManage",e),e.$inject=[]}(),function(){function e(){function e(){return"selectOptionManage is here."}function o(e){p(e)}function l(e,o){for(var l=e.rows.length-1;l>=0;l--)if(e.rows[l].option===o)return!1;return!0}function t(e){return""!==e?!0:!1}function n(e,o){var l={resultFlag:!1,details:""},t=d(e,o);if(t.resultFlag===!0){var n={option:o,order:e.rows.length};return e.rows.push(n),l.resultFlag=!0,l.details="",l}return angular.copy(t,l),l}function i(e,o){var l={resultFlag:!1,details:""},t=d(e,o);if(t.resultFlag===!0){var n={option:o,order:e.rows.length};return e.rows.push(n),l.resultFlag=!0,l.details="",l}return angular.copy(t,l),l}function s(e,o,l){var t={resultFlag:!1,details:""},n=d(e,o);if(n.resultFlag===!0){var i={option:o,group:l,order:e.rows.length};return e.rows.push(i),t.resultFlag=!0,t.details="",t}return angular.copy(n,t),t}function a(e,o){var l={resultFlag:!1,details:""};return-1!==o?(e.rows.splice(o,1),l.resultFlag=!0,l.details="",l):(l.resultFlag=!1,l.details="Option index not valid",l)}function r(e,o){var l={resultFlag:!1,details:""};if(o>-1){if(o>0){if(e.rows[o-1]){var t=e.rows[o];return e.rows.splice(o,1),e.rows.splice(o-1,0,t),l.resultFlag=!0,l.details="",l}return l.resultFlag=!1,l.details="Can't retreive option from option index",l}return l.resultFlag=!0,l.details="",l}return l.resultFlag=!1,l.details="Option index not valid",l}function c(e,o){var l={resultFlag:!1,details:""};if(o>-1){if(o=0;t--)if(e.rows[t].option===o)return l.resultFlag=!1,l.details="Entered option is not unique",l;return l.resultFlag=!0,l.details="",l}return l.resultFlag=!1,l.details="Entered option is empty",l}function p(e){var o={rows:[]};angular.copy(o,e)}var u={testMe:e,initModel:o,isOptionUnique:l,isOptionValidFormat:t,addNewOptionRadio:n,addNewOptionBasicSelect:i,addNewOptionGroupedSelect:s,removeOption:a,upthisOption:r,downthisOption:c};return u}angular.module("ngwfApp.services.selectOptionManage",[]).factory("selectOptionManage",e),e.$inject=[]}(),function(){angular.module("ngwfApp.services",["ngwfApp.services.formFieldManage","ngwfApp.services.selectOptionManage","ngwfApp.services.ngwfEditCtrlControllerModalProxy"])}(),function(){angular.module("ngwfApp.filters",[])}()}(this); diff --git a/dist/public/js/eda.stepway.js.map b/dist/public/js/eda.stepway.js.map index 8f4c7348..349339bf 100644 --- a/dist/public/js/eda.stepway.js.map +++ b/dist/public/js/eda.stepway.js.map @@ -1 +1 @@ -{"version":3,"sources":["eda.stepway.js"],"names":["configfct","formlyConfigProvider","camelize","string","replace","match","chr","toUpperCase","toLowerCase","setType","name","template","subTitleTemplate","basicSelectTemplate","groupedSelectTemplate","attributes","bindings","ngModelAttrs","angular","forEach","attr","attribute","binding","bound","wrapper","controller","$scope","open","$event","preventDefault","stopPropagation","opened","defaultOptions","templateOptions","addonLeft","class","onClick","options","scope","isOpen","onFocus","$viewValue","$modelValue","to","datepickerOptions","setWrapper","join","module","value","config","$inject","run","$templateCache","put","ngwfMainController","$timeout","FormNameAsTest","ngwfWfEditController","easyFormGenVersion","$filter","$anchorScroll","toaster","$modal","$log","formFieldManage","controllerModalProxy","initDebugModel","showDebug","configurationModelNumberofLines","initTabModel","editTab","active","previewTab","previewExistingform","formlyform","configlines","JSON","parse","formlyField","configurationLoaded","bindConfigurationLines","applyConfigurationToformlyModel","previewLoadedForm","fieldsModel","vm","model","wfFormFieldsOnlyNeededProperties","copy","wfFormFields","cancelButtonText","submitButtonText","onSubmit","pop","type","timeout","title","body","showCloseButton","initColumnTemplate","numColumn","exist","control","key","subtype","initLineTemplate","line","activeColumn","columns","resetToZeroModel","configuration","activeLine","lines","length","splice","countConfigurationModelLines","debug","setActiveLineNumber","lineNumber","upThisLine","indexLine","currentLineObj","downThisLine","addNewline","push","removeThisLine","index","increaseNumberOfColumns","MaxNumberOfColumns","newNumberOfColumns","decreaseNumberOfColumns","resetStepCounter","configStepCounter","nextConfigStep","configStepCounterMAX","listConfigStep","setTrueThisStepIndicator","previousConfigStep","stepReachable","indexStep","showModalAddCtrlToColumn","size","numcolumn","modalInstance","animation","animationsEnabled","templateUrl","resolve","nyaSelect","getNyASelectFromSelectedLineColumn","result","then","modalAddCtrlModel","bindConfigurationModelFromModalReturn","toggleAnimation","loadExistingFormsAsList","saveThisForm","formName","clear","resetAllIndicators","i","stepIndicators","indexIndicator","this","easyFormGeneratorVERSION","tab","numberOfColumns","MinNumberOfColumns","columnTemplate","lineTemplate","loadExistingFormsList","formlyList","initConfigurationEditFromScratch","initNyaSelect","ngwfWfEditMODALController","$modalInstance","selectOptionManage","addNewOptionRadio","radioRowCollection","newOptionRadio","saisie","resultFlag","details","removeRadioRow","removeOption","upThisRadioRow","upthisOption","downThisRadioRow","downthisOption","addNewOptionBasicSelect","basicSelectRowCollection","newOptionBasicSelect","removeRow","upThisRow","downThisRow","showGroupListToChoose","groupSelectGroupClick","showList","addNewGroupToGroupedSelect","newGroupGroupedSelect","GroupedSelectGroups","list","addNewOptionGroupedSelect","groupedSelectRowCollection","newOptionGroupedSelect","removeGroupedSelectRow","upThisGroupedSelectRow","downThisGroupedSelectRow","today","demodt","dt","Date","openfct","dateOptionsInit","formatYear","startingDay","showWeeks","initDate","selectThisControl","controlName","selectedControl","resetTemporyConfig","controls","id","initDatePicker","okfct","bindBasicSelectToNya","bindGroupedSelectToNya","bindRadioToNya","applyConfigToSelectedControl","close","cancelfct","dismiss","bindRadioFromNYA","temporyConfig","formlyOptions","newOption","option","order","group","rows","resetNyASelectOptions","bindBasicSelectFromNYA","bindGroupedSelectFromNYA","filteredgroup","_","uniq","pluck","datepickerPopup","formats","initNyaSelectConformingSelectedControl","modelNyaSelect","formlyLabel","formlyRequired","formlyPlaceholder","formlyDesciption","initOptionModel","dateOptions","ok","cancel","edaStepWayEasyFormGen","linkFct","element","attrs","returnAttributeConfigurationLinesIfNotEmpty","edaEasyFormGeneratorModelToReturn","isArray","edaEasyFormGeneratorModel","edaFieldsModel","emptyEdaFieldsModel","emptyModel","returnAttributeDataModelIfNotEmpty","dataModelToReturn","dataModel","watchEdaEasyFormModelExpression","watchEdaEasyFormModelHasChanged","newValue","oldValue","loadExistingConfigurationModel","watchReturnSaveEventExpression","returnSaveEvent","watchReturnSaveEventhasChanged","_easyFormGeneratorModel","btnSubmitText","btnCancelText","edaFieldsModelStringified","toJson","formlyFieldsModel","edaSaveFormEvent","isDefined","refreshControlFormlyExpressionProperties","refreshControlFormlyValidators","refreshControlFormlyValidation","isString","$watch","edaStepWayEasyFormGenCtrl","directive","restrict","controllerAs","link","stRatio","linkfct","ratio","css","nyaSelectObj","resetNyaSelect","getControlsDefinition","configurationModel","isObject","column","controlIndex","_controlsDefinition","aControl","aControlIndex","formlyType","formlySubtype","formlyExpressionProperties","formlyValidators","formlyValidation","configurationObj","label","required","description","placeholder","extractedProps","returnControlFromAddCtrlModalModel","newKey","now","validKeyUniqueness","edited","newNyaSelectObj","subtitle","messages","viewValue","modelValue","defaultReturnMsg","returnMsg","emailShape","expression","test","message","CtrlModalModel","modelToReturn","thisKey","isUnique","j","service","factory","configurationModelInit","Object","prototype","toString","call","configurationModelResult","concat","getMessageObject","getErrorObject","formlyModel","formlyDataModel","resetFormlyModel","resetDataModel","addOneColumnHeader","addOneColumnControl","addTwoColumnControl","addThreeColumnControl","resetformly","lineIndex","headerTemplateCol0","extractTemplateOptionDescription","addDatepickerPopupProperty","fieldToPush","extractTemplateOptionDatepickerPopup","className","extractTemplateOptionType","extractTemplateOptionLabel","extractTemplateOptionRequired","extractTemplateOptionPlaceholder","extractTemplateOptionOptions","expressionProperties","extractFormlyExpressionProperties","validators","extractFormlyValidators","validation","extractFormlyValidation","headerTemplateCol1","controlCol0","controlCol1","FieldGroup","fieldGroup","headerTemplateCol2","controlCol2","obj","emptyDataModel","errorTitle","errorMessage","messageObj","noError","Message","messageTitle","messageBody","testMe","initModel","selectObj","resetModel","isOptionUnique","textValue","isOptionValidFormat","newOptionText","fullResponse","checkResult","validOption","newOptionGroup","AtIndex","indexOption","currentOption","zeroModel"],"mappings":"CAOE,WACA,cAeD,WAqBG,QAASA,GAAUC,GAyKjB,QAASC,GAASC,GAKhB,MAJAA,GAASA,EAA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AC1BmO,EAAalO,QAAU,GAClBkO,EAKT,MAFAA,GAAanO,YAAa,EAC1BmO,EAAalO,QAAU,yBAChBkO,EASb,QAASE,GAAYR,EAAWK,GAC5B,GAAIC,IACkBnO,YAAc,EACdC,QAAc,GAGpC,IAA6B,mBAAlBiO,GAGP,MAFAC,GAAanO,YAAa,EAC1BmO,EAAalO,QAAa,0BACnBkO,CAGX,IAAsB,KAAlBD,EAAsB,CACpB,IAAK,GAAIvP,GAAIkP,EAAUlK,KAAK/H,OAAS,EAAG+C,GAAK,EAAGA,IAC9C,GAAIkP,EAAUlK,KAAKhF,GAAG6E,SAAW0K,EAG/B,MAFAC,GAAanO,YAAa,EAC1BmO,EAAalO,QAAa,+BACnBkO,CAKX,OAFAA,GAAanO,YAAa,EAC1BmO,EAAalO,QAAa,GACnBkO,EAIb,MAFAA,GAAanO,YAAa,EAC1BmO,EAAalO,QAAa,0BACnBkO,EAGX,QAASL,GAAWD,GAClB,GAAIa,IAAc/K,QAClB7N,SAAQqE,KAAKuU,EAAWb,GAvO1B,GAAIxD,IACFsD,OAA4BA,EAC5BC,UAA4BA,EAC5BG,eAA4BA,EAC5BE,oBAA4BA,EAC5BrO,kBAA4BA,EAC5BY,wBAA4BA,EAC5Ba,0BAA4BA,EAC5BlB,aAA4BA,EAC5BE,aAA4BA,EAC5BE,eAA4BA,EAE9B,OAAO8J,GAlBXvU,QACG6B,OAAO,0CACP2S,QAAQ,qBAAsB3K,GAE/BA,EAAmB7H,cAyiBtB,WAGAhC,QAAQ6B,OACA,oBACW,mCACA,sCACA,yDAmBnB,WAGA7B,QACE6B,OAAO,0BAMPmH","file":"eda.stepway.js","sourcesContent":["/** \n *easyFormGenerator — step way — version \n *Version 1.0.8 \n *Author : Erwan Datin (MacKentoch) \n *Link: https://github.com/MacKentoch/easyFormGenerator \n *License : MIT (2015) \n **/ \n ;(function(){\n \t'use strict';\n/**\n * -----------------------------------------------------------------------\n * application module of the step way version of easy form generator\n * -----------------------------------------------------------------------\n * \n * \n * - this version is production friendly -\n *\n * \n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n;(function(){\n 'use strict';\n\n\n angular\n .module('ngwfApp', [ \n 'ngwfApp.core',\n 'ngwfApp.controllers',\n 'ngwfApp.services', \n 'ngwfApp.filters',\n 'ngwfApp.directives'\n ])\n .value('easyFormGenVersion', 'v1.0.8')\n .config(configfct);\n\n\n\n\n\n\n configfct.$inject = ['formlyConfigProvider'];\n function configfct(formlyConfigProvider){\n //////////////////////////////\n // CONFIG HERE (formly...) \n /////////////////////////////\n formlyConfigProvider.setType(\n {\n name: 'richEditor',\n //wrapper: ['bootstrapLabel', 'bootstrapHasError'],\n template: ''\n }\n );\n\n formlyConfigProvider.setType(\n {\n name: 'blank',\n template: '
'\n }\n );\n\n\n var subTitleTemplate = '

{{options.templateOptions.placeholder}}


';\n formlyConfigProvider.setType(\n {\n name: 'subTitle',\n template: subTitleTemplate\n }\n );\n\n var basicSelectTemplate = '
    ' + \n '
  1. ' + \n ' {{option.name}} ' + \n '
  2. ' + \n '
' ;\n\n formlyConfigProvider.setType(\n {\n name: 'basicSelect',\n template: basicSelectTemplate\n }\n );\n\n\n var groupedSelectTemplate = '
    ' +\n '
  1. ' +\n ' {{$group}}' + \n ' ' +\n ' {{option.name}}' +\n ' ' +\n ' ' +\n '
  2. ' +\n '
';\n\n formlyConfigProvider.setType(\n {\n name: 'groupedSelect',\n template: groupedSelectTemplate\n }\n );\n\n ////////////////////////////\n // angular UI date picker\n ////////////////////////////\n // thx Kent C. Dodds\n\n var attributes = [\n 'date-disabled',\n 'custom-class',\n 'show-weeks',\n 'starting-day',\n 'init-date',\n 'min-mode',\n 'max-mode',\n 'format-day',\n 'format-month',\n 'format-year',\n 'format-day-header',\n 'format-day-title',\n 'format-month-title',\n 'year-range',\n 'shortcut-propagation',\n 'datepicker-popup',\n 'show-button-bar',\n 'current-text',\n 'clear-text',\n 'close-text',\n 'close-on-date-selection',\n 'datepicker-append-to-body'\n ];\n\n var bindings = [\n 'datepicker-mode',\n 'min-date',\n 'max-date'\n ];\n\n var ngModelAttrs = {};\n\n angular.forEach(attributes, function(attr) {\n ngModelAttrs[camelize(attr)] = {attribute: attr};\n });\n\n angular.forEach(bindings, function(binding) {\n ngModelAttrs[camelize(binding)] = {bound: binding};\n });\n\n \n\n formlyConfigProvider.setType({\n name: 'datepicker',\n template: '',\n wrapper: ['bootstrapLabel', 'bootstrapHasError'],\n controller: ['$scope', function($scope) {\n $scope.open = function($event) {\n $event.preventDefault();\n $event.stopPropagation();\n $scope.opened = true;\n };\n \n }],\n defaultOptions: {\n ngModelAttrs: ngModelAttrs,\n templateOptions: {\n addonLeft: {\n class: 'glyphicon glyphicon-calendar',\n onClick: function(options, scope) {\n options.templateOptions.isOpen = !options.templateOptions.isOpen;\n }\n }, \n onFocus: function($viewValue, $modelValue, scope) {\n scope.to.isOpen = !scope.to.isOpen;\n },\n datepickerOptions: {}\n }\n }\n \n });\n\n\n\n /**\n * wrappers to show validation errors\n * without having to rewrite formly types\n */\n formlyConfigProvider.setWrapper([\n {\n template: [\n '
',\n ' ',\n '
',\n '
',\n '
',\n ' {{message(options.formControl.$viewValue, options.formControl.$modelValue, this)}}',\n '
',\n '
',\n '
'\n ].join(' ')\n }\n ]);\n\n function camelize(string) {\n string = string.replace(/[\\-_\\s]+(.)?/g, function(match, chr) {\n return chr ? chr.toUpperCase() : '';\n });\n // Ensure 1st char is always lowercase\n return string.replace(/^([A-Z])/, function(match, chr) {\n return chr ? chr.toLowerCase() : '';\n });\n } \n\n }\n\n\n})();\n\nangular.module(\"ngwfApp\").run([\"$templateCache\", function($templateCache) {$templateCache.put(\"edaStepWayEasyFormGeneratorTemplate.html\",\"

lines

layout

controls

save

Command

Add a new line : 

Visual

  • 1\\\">
    1\\\">
    1\\\">

Command

– Selected line –

number of columns :

{{configuration.lines[configuration.activeLine -1].columns.length}}

Visual

  • 1\\\">
    1\\\">
    1\\\">

Command

– Apply controls to columns –


  Click / Tap on column to open control selection.

  Select desired control and valid to apply it to column.

Visual

  • 1\\\">
    1\\\">
    1\\\">

 Command



 Final Step : form preview

DATA MODEL

\\n\t\t\t\t\t\t\t\t\t\t{{vm.model | json}}\\n\t\t\t\t\t\t\t\t\t

FIELDS MODEL (ready to save to database one)

\\n\t\t\t\t\t\t\t\t\t\t{{vm.wfFormFieldsOnlyNeededProperties | json}}\\n\t\t\t\t\t\t\t\t\t

Easy form generator : {{easyFormGeneratorVERSION}} — Erwan DATIN (MacKentoch)
\");\n$templateCache.put(\"editModalTemplate.html\",\"\");}]);\n/**\n * ------------------------------------------------------\n * module core : injects core \"non app modules\"\n * ------------------------------------------------------\n *\n * \n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n\n(function () {\n\t'use strict';\n\n\tangular\n\t\t.module('ngwfApp.core', [\n\t 'textAngular',\n\t 'textAngularSetup',\n\t 'ngAnimate',\n\t 'toaster', \n\t 'formly', \n\t 'formlyBootstrap',\n\t 'ui.bootstrap',\n\t 'nya.bootstrap.select'\n\t\t]);\n\n})(); \n\n/**\n * ------------------------------------------------------\n * controllers container\n * ------------------------------------------------------\n *\n * \n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n(function () {\n\t'use strict';\n\n\n\tangular.module('ngwfApp.controllers', [\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ngwfApp.controllers.ngwfMainController',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ngwfApp.controllers.ngwfWfEditController',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ngwfApp.controllers.ngwfWfEditMODALController'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t);\n\n})(); \n\n\n/**\n * ------------------------------------------------------\n * module = \"controller\" main controller\n * ------------------------------------------------------\n *\n *\n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n\n;(function () {\n\t'use strict';\n\n\tangular\n\t\t.module('ngwfApp.controllers.ngwfMainController', [])\n\t\t.controller('ngwfMainController', ngwfMainController);\n\n\t\tngwfMainController.$inject = ['$scope', '$timeout'];\n\t\tfunction ngwfMainController($scope, $timeout){\n\t\t\t\n\t\t\t$scope.FormNameAsTest = 'initial_name';\n\t\t\t\n\t\t\t$timeout(function(){\n\t\t\t\t$scope.FormNameAsTest = 'name changed after 3s';\n\t\t\t}, 3000);\n\t\t}\n\n})(); \n\n\n/**\n * ------------------------------------------------------\n * module = \"controller\" edit controller\n * ------------------------------------------------------\n *\n * Main controller :\n * \n * - configuration model : fields model database friendly\n * - formlymodel : fields model bound to formly directive (not database freindly)\n * - vm.model : data model (database friendly)\n *\n * if you want more details on how to save to data base :\n *\n * http://www.erwan-datin.com/tips/how-do-I-store-angular-formly-fields-model-into-database\n *\n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n\n(function () {\n\n 'use strict';\n\n angular\n .module('ngwfApp.controllers.ngwfWfEditController', [])\n .controller('ngwfWfEditController', ngwfWfEditController);\n\n\n ngwfWfEditController.$inject = [\n '$scope', \n '$templateCache',\n 'easyFormGenVersion',\n '$filter',\n '$anchorScroll',\n 'toaster', \n '$timeout',\n '$modal',\n '$log', \n 'formFieldManage',\n 'controllerModalProxy',\n ];\n\n \n function ngwfWfEditController(\n $scope, \n $templateCache,\n easyFormGenVersion,\n $filter,\n $anchorScroll,\n toaster,\n $timeout, \n $modal,\n $log, \n formFieldManage, \n controllerModalProxy\n ){\n /*jshint validthis: true */\n $scope.vm = this;\n $scope.vm.model = {};\n $scope.vm.wfFormFields = [];\n $scope.vm.wfFormFieldsOnlyNeededProperties = []; \n $scope.vm.onSubmit = onSubmit;\n\n $scope.easyFormGeneratorVERSION = easyFormGenVersion;\n $scope.debug = initDebugModel();\n $scope.tab = initTabModel();\n\n //configuration model (contains array of lines which contains array of columns)\n $scope.configuration = {}; \n \n $scope.numberOfColumns = 1;\n $scope.MaxNumberOfColumns = 3;\n $scope.MinNumberOfColumns = 1;\n $scope.columnTemplate = initColumnTemplate();\n\n $scope.lineTemplate = initLineTemplate();\n $scope.resetToZeroModel = resetToZeroModel;\n $scope.countConfigurationModelLines = countConfigurationModelLines;\n $scope.setActiveLineNumber = setActiveLineNumber;\n $scope.upThisLine = upThisLine;\n $scope.downThisLine = downThisLine;\n $scope.addNewline = addNewline;\n $scope.removeThisLine = removeThisLine;\n\n $scope.increaseNumberOfColumns = increaseNumberOfColumns;\n $scope.decreaseNumberOfColumns = decreaseNumberOfColumns;\n\n $scope.resetStepCounter = resetStepCounter;\n $scope.nextConfigStep = nextConfigStep;\n\n $scope.previousConfigStep = previousConfigStep;\n $scope.stepReachable = stepReachable;\n\n $scope.toggleAnimation = toggleAnimation;\n\n $scope.nyaSelect = {};\n \n $scope.animationsEnabled = true;\n //call modal to edit selected control\n $scope.showModalAddCtrlToColumn = showModalAddCtrlToColumn;\n\n \n //disabled here : to load list of saved formly fields from database\n $scope.loadExistingFormsList = loadExistingFormsAsList();\n $scope.formlyList = {};\n $scope.previewLoadedForm = { fieldsModel:[] };\n $scope.configurationLoaded = {}; \n $scope.previewExistingform = previewExistingform;\n $scope.saveThisForm = saveThisForm; //should save to database (commented here)\n\n\n \n\n\n \n\n\n\n //load formlyList on init\n loadExistingFormsAsList();\n\n formFieldManage.initConfigurationEditFromScratch($scope.configuration);\n\n controllerModalProxy.initNyaSelect($scope.nyaSelect);\n\n\n\n function initDebugModel(){\n return {\n showDebug : false,\n configurationModelNumberofLines : 1 \n };\n }\n\n function initTabModel(){\n return {\n editTab : {active : true},\n previewTab : {active : false}\n };\n }\n\n function previewExistingform(formlyform){\n var configlines = JSON.parse(formlyform.formlyField);\n //here to replace with $scope.configuration : initialise configuration with lines \n $scope.configurationLoaded = {};\n formFieldManage.bindConfigurationLines($scope.configurationLoaded,configlines);\n formFieldManage.applyConfigurationToformlyModel($scope.configurationLoaded, $scope.previewLoadedForm.fieldsModel, $scope.vm.model);\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields);\n $scope.previewLoadedForm.cancelButtonText = formlyform.cancelButtonText;\n $scope.previewLoadedForm.submitButtonText = formlyform.submitButtonText;\n } \n\n function onSubmit() {\n toaster.pop({\n type: 'info',\n timeout:2000,\n title: 'should save data model if it were not a static example',\n body: 'data :' + $filter('json')($scope.vm.model, 4), \n showCloseButton: true\n }); \n }\n \n function initColumnTemplate(){\n return {\n numColumn: -1,\n exist:true, \n control: {\n type:'none',\n key: 'none',\n subtype: 'none',\n // templateOptions: {\n // label: 'none',\n // placeholder: 'none',\n // required: false,\n // description: 'Descriptive text'\n // }\n } \n };\n }\n\n function initLineTemplate(){\n return {\n line:-1, \n activeColumn : 1,\n columns: [\n { \n numColumn: 1,\n exist:true, \n control: {\n type:'none',\n key: 'none',\n // templateOptions: {\n // label: 'none',\n // placeholder: 'none',\n // required: false,\n // description: 'Descriptive text'\n // }\n }\n }\n ]\n };\n }\n\n function resetToZeroModel(){\n $scope.configuration.activeLine = 1;\n if ($scope.configuration.lines.length > 1) {\n $scope.configuration.lines.splice(1, $scope.configuration.lines.length - 2);\n }\n return $scope.countConfigurationModelLines();\n }\n\n function countConfigurationModelLines(){\n //information in debug model\n $scope.debug.configurationModelNumberofLines = $scope.configuration.lines.length;\n return $scope.configuration.lines.length;\n } \n\n function setActiveLineNumber(lineNumber){\n if (lineNumber <= $scope.countConfigurationModelLines()) {\n $scope.configuration.activeLine = lineNumber;\n }\n } \n\n function upThisLine(indexLine){ \n if (indexLine > -1) {\n if ($scope.configuration.lines[indexLine - 1]) {\n var currentLineObj = $scope.configuration.lines[indexLine];\n $scope.configuration.lines.splice(indexLine , 1);\n $scope.configuration.lines.splice((indexLine - 1), 0, currentLineObj); \n //manage selected aciveLine\n $scope.configuration.activeLine = 1;\n }\n }\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model);\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields); \n } \n\n function downThisLine(indexLine){\n if (indexLine > -1) {\n if ($scope.configuration.lines[indexLine + 1]) {\n var currentLineObj = $scope.configuration.lines[indexLine];\n $scope.configuration.lines.splice(indexLine , 1);\n $scope.configuration.lines.splice((indexLine + 1), 0, currentLineObj); \n //manage selected aciveLine\n $scope.configuration.activeLine = 1;\n }\n } \n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model); \n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields); \n } \n\n function addNewline(){\n $scope.configuration.lines.push(\n {\n line:-1, \n activeColumn : 1,\n columns: [\n { \n numColumn: 1,\n exist:true, \n control: {\n type:'none',\n key: 'none',\n // templateOptions: {\n // label: 'none',\n // placeholder: 'none',\n // required: false,\n // description: 'Descriptive text'\n // }\n }\n }\n ]\n }\n );\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model);\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields); \n }\n\n function removeThisLine(index){\n if (index > -1) {\n if ($scope.configuration.lines.length > 1) {\n //manage selected aciveLine\n if ($scope.configuration.activeLine === index + 1) {\n $scope.configuration.activeLine = 1;\n }\n $scope.configuration.lines.splice(index, 1);\n }else{\n $timeout(function(){\n toaster.pop({\n type: 'warning',\n title: 'Last line' ,\n body: 'Can\\'t delete the last line', \n showCloseButton: true\n });\n }, 100); \n }\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model);\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields);\n }\n }\n\n function increaseNumberOfColumns(){\n if ($scope\n .configuration\n .lines[$scope.configuration.activeLine -1]\n .columns.length < $scope.MaxNumberOfColumns) {\n\n var newNumberOfColumns = $scope\n .configuration\n .lines[$scope.configuration.activeLine -1]\n .columns\n .push(\n {\n numColumn: -1,\n exist: true, \n control: {\n type:'none',\n key: 'none'\n // templateOptions: {\n // label: 'none',\n // placeholder: 'none',\n // required: false,\n // description: 'Descriptive text'\n // }\n } \n } \n );\n $scope\n .configuration\n .lines[$scope.configuration.activeLine -1]\n .columns[newNumberOfColumns - 1]\n .numColumn = newNumberOfColumns; \n }\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model); \n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields);\n } \n\n function decreaseNumberOfColumns(){\n if ($scope\n .configuration\n .lines[$scope.configuration.activeLine -1]\n .columns.length > 1) {\n $scope.configuration\n .lines[$scope.configuration.activeLine -1]\n .columns\n .splice($scope.configuration.lines[$scope.configuration.activeLine -1].columns.length -1, 1);\n }\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model); \n\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields); \n } \n\n function resetStepCounter(){\n $scope.configuration.configStepCounter = 0;\n } \n\n function nextConfigStep(){\n var configStepCounterMAX = $scope.configuration.listConfigStep.length -1;\n if ($scope.configuration.configStepCounter !== configStepCounterMAX) {\n $scope.configuration.configStepCounter ++;\n } \n setTrueThisStepIndicator($scope.configuration.configStepCounter);\n } \n\n function previousConfigStep(){\n if ($scope.configuration.configStepCounter !== 0) {\n $scope.configuration.configStepCounter --;\n }\n setTrueThisStepIndicator($scope.configuration.configStepCounter);\n }\n\n function stepReachable(indexStep){\n if (indexStep < $scope.configuration.configStepCounter) {\n return 'disabled';\n }else{\n return 'enabled';\n }\n } \n\n function showModalAddCtrlToColumn(size, indexLine, numcolumn) {\n\n var modalInstance = $modal.open({\n animation: $scope.animationsEnabled,\n templateUrl: 'editModalTemplate.html', \n controller: 'ngwfWfEditMODALController',\n size: 'lg',\n resolve: {\n nyaSelect: function () {\n return controllerModalProxy\n .getNyASelectFromSelectedLineColumn($scope.nyaSelect, $scope.configuration,indexLine, numcolumn);\n }\n }\n });\n\n modalInstance.result.then(function (modalAddCtrlModel) {\n controllerModalProxy.bindConfigurationModelFromModalReturn(indexLine, numcolumn, modalAddCtrlModel, $scope.configuration);\n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model);\n \n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields);\n\n }, function () {\n //$log.info('Modal dismissed at: ' + new Date());\n });\n } \n\n function toggleAnimation() {\n $scope.animationsEnabled = !$scope.animationsEnabled;\n } \n\n\n\n\n /**\n * loadExistingFormsAsList :\n * - LOAD from database (list of forms)\n */\n function loadExistingFormsAsList(){\n \n }\n /**\n * saveThisForm \n * - SAVE to database (current stringified configuration model === current form)\n */\n function saveThisForm(){\n if (typeof $scope.configuration.formName === 'undefined') {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: 'Form name is undefined',\n body: 'Form has not been saved.', \n showCloseButton: true\n });\n return false;\n }\n if ($scope.configuration.formName === '') {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: 'Form name is required',\n body: 'Form has not been saved.', \n showCloseButton: true\n });\n return false;\n }\n toaster.pop({\n type: 'wait',\n timeout:10000,\n title: 'Form is being saved',\n body: 'Wait.', \n showCloseButton: true\n });\n\n \n toaster.clear(); \n toaster.pop({\n type: 'info',\n timeout:2000,\n title: 'Form would be saved if it were not a static example',\n body: '', \n showCloseButton: true\n }); \n return true;\n } \n\n\n\n\n function resetAllIndicators(){\n for (var i = $scope.configuration.stepIndicators.length - 1; i >= 0; i--) {\n $scope.configuration.stepIndicators[i] = false;\n }\n }\n \n function setTrueThisStepIndicator(indexIndicator){\n resetAllIndicators();\n $scope.configuration.stepIndicators[indexIndicator] = true; \n }\n\n\n\n\n\n }\n\n\n})(); \n/**\n * ------------------------------------------------------\n * module = \"controller\" modal controller\n * ------------------------------------------------------\n *\n * edit control modal controller\n *\n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n\n(function () {\n 'use strict';\n\n\n angular\n .module('ngwfApp.controllers.ngwfWfEditMODALController', [])\n .controller('ngwfWfEditMODALController', ngwfWfEditMODALController);\n\n ngwfWfEditMODALController.$inject = [\n '$scope', \n '$modalInstance',\n 'nyaSelect',\n 'toaster' ,\n '$timeout',\n 'selectOptionManage',\n 'controllerModalProxy',\n ];\n\n function ngwfWfEditMODALController( $scope, \n $modalInstance, \n nyaSelect, \n toaster,\n $timeout,\n selectOptionManage,\n controllerModalProxy\n ){\n \n var initOptionModel = { rows:[] };\n\n $scope.radioRowCollection = initOptionModel;\n $scope.newOptionRadio = {saisie: ''};\n\n $scope.addNewOptionRadio = addNewOptionRadio;\n $scope.removeRadioRow = removeRadioRow;\n $scope.upThisRadioRow = upThisRadioRow;\n $scope.downThisRadioRow = downThisRadioRow;\n\n $scope.basicSelectRowCollection = initOptionModel;\n $scope.newOptionBasicSelect = {saisie: ''}; \n $scope.addNewOptionBasicSelect = addNewOptionBasicSelect;\n $scope.removeRow = removeRow;\n $scope.upThisRow = upThisRow;\n $scope.downThisRow = downThisRow;\n\n $scope.groupedSelectRowCollection = initOptionModel;\n $scope.newOptionGroupedSelect = {saisie: ''};\n $scope.GroupedSelectGroups = { list:[] };\n $scope.newGroupGroupedSelect = {saisie: ''}; \n $scope.groupSelectGroupClick = {showList : false};\n $scope.showGroupListToChoose = showGroupListToChoose;\n $scope.addNewGroupToGroupedSelect = addNewGroupToGroupedSelect;\n $scope.addNewOptionGroupedSelect = addNewOptionGroupedSelect;\n $scope.removeGroupedSelectRow = removeGroupedSelectRow;\n $scope.upThisGroupedSelectRow = upThisGroupedSelectRow;\n $scope.downThisGroupedSelectRow = downThisGroupedSelectRow;\n\n $scope.demodt = {}; \n $scope.today = today;\n $scope.clear = clear;\n $scope.open = openfct;\n $scope.dateOptions = dateOptionsInit(); \n $scope.demodt.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];\n\n $scope.nyaSelect = nyaSelect ;\n $scope.nyaSelect.selectedControl = $scope.nyaSelect.temporyConfig.selectedControl;\n $scope.selectThisControl = selectThisControl;\n $scope.ok = okfct;\n $scope.cancel = cancelfct;\n\n\n\n //init today date\n today();\n //init nyaSelect model depending selected control\n initNyaSelectConformingSelectedControl();\n\n\n \n \n function addNewOptionRadio(){\n var result = selectOptionManage.addNewOptionRadio($scope.radioRowCollection, $scope.newOptionRadio.saisie);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: '\\''+ $scope.newOptionRadio.saisie + '\\'' + ' cannot be added.', \n showCloseButton: true\n });\n }\n //reset input\n $scope.newOptionRadio = {saisie: ''};\n }\n\n function removeRadioRow(index) {\n var result = selectOptionManage.removeOption($scope.radioRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Delete was cancelled.', \n showCloseButton: true\n });\n } \n } \n\n function upThisRadioRow(index){\n var result = selectOptionManage.upthisOption($scope.radioRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Operation cancelled.', \n showCloseButton: true\n });\n } \n }\n\n function downThisRadioRow(index){\n var result = selectOptionManage.downthisOption($scope.radioRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Operation cancelled.', \n showCloseButton: true\n });\n }\n }\n\n function addNewOptionBasicSelect(){\n var result = selectOptionManage.addNewOptionBasicSelect($scope.basicSelectRowCollection, $scope.newOptionBasicSelect.saisie);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: '\\''+ $scope.newOptionBasicSelect.saisie + '\\'' + ' cannot be added.', \n showCloseButton: true\n });\n }\n //reset input\n $scope.newOptionBasicSelect = {saisie: ''};\n } \n\n function removeRow(index) {\n var result = selectOptionManage.removeOption($scope.basicSelectRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Delete was cancelled.', \n showCloseButton: true\n });\n } \n } \n\n function upThisRow(index){\n var result = selectOptionManage.upthisOption($scope.basicSelectRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Operation cancelled.', \n showCloseButton: true\n });\n } \n }\n\n function downThisRow(index){\n var result = selectOptionManage.downthisOption($scope.basicSelectRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Operation cancelled.', \n showCloseButton: true\n });\n }\n }\n\n function showGroupListToChoose(){\n $scope.groupSelectGroupClick.showList = !$scope.groupSelectGroupClick.showList;\n }\n\n function addNewGroupToGroupedSelect(){\n if ($scope.newGroupGroupedSelect.saisie !== '') {\n for (var i = $scope.GroupedSelectGroups.list.length - 1; i >= 0; i--) {\n if ($scope.GroupedSelectGroups.list[i] === $scope.newGroupGroupedSelect.saisie) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: 'Group already exists',\n body: 'No group added.', \n showCloseButton: true\n }); \n }\n }\n $scope.GroupedSelectGroups.list.push($scope.newGroupGroupedSelect.saisie);\n }else{\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: 'Not a valid group to add',\n body: 'No group added.', \n showCloseButton: true\n });\n }\n $scope.newGroupGroupedSelect.saisie = '';\n } \n\n function addNewOptionGroupedSelect(){\n var result = selectOptionManage.addNewOptionGroupedSelect($scope.groupedSelectRowCollection, $scope.newOptionGroupedSelect.saisie, '');\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: '\\''+ $scope.newOptionGroupedSelect.saisie + '\\'' + ' cannot be added.', \n showCloseButton: true\n });\n }\n //bind nya : dont bind here $apply is not done fast enough\n //bindGroupedSelectToNya();\n //reset input\n $scope.newOptionGroupedSelect = {saisie: ''};\n }\n\n function removeGroupedSelectRow(index) {\n var result = selectOptionManage.removeOption($scope.groupedSelectRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Delete was cancelled.', \n showCloseButton: true\n });\n } \n } \n\n function upThisGroupedSelectRow(index){\n var result = selectOptionManage.upthisOption($scope.groupedSelectRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Operation cancelled.', \n showCloseButton: true\n });\n } \n }\n\n function downThisGroupedSelectRow(index){\n var result = selectOptionManage.downthisOption($scope.groupedSelectRowCollection, index);\n if (result.resultFlag === false) {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: result.details,\n body: 'Operation cancelled.', \n showCloseButton: true\n });\n } \n }\n\n function today() {\n $scope.demodt.dt = new Date();\n } \n\n function clear() {\n $scope.demodt.dt = null;\n } \n\n function openfct($event){\n $event.preventDefault();\n $event.stopPropagation();\n $scope.demodt.opened = true;\n }\n\n function dateOptionsInit(){\n return {\n formatYear: 'yy',\n startingDay: 1,\n showWeeks: true,\n initDate: null\n };\n }\n\n function selectThisControl(controlName){\n $scope.nyaSelect.selectedControl = 'none';\n resetTemporyConfig();\n\n for (var i = $scope.nyaSelect.controls.length - 1; i >= 0; i--) {\n if ($scope.nyaSelect.controls[i].id === controlName) {\n $scope.nyaSelect.selectedControl = $scope.nyaSelect.controls[i].id; \n }\n }\n\n if ($scope.nyaSelect.selectedControl === 'Date') {\n initDatePicker();\n }\n } \n\n function okfct() {\n if ($scope.nyaSelect.selectedControl === 'BasicSelect') {\n bindBasicSelectToNya();\n }\n if ($scope.nyaSelect.selectedControl === 'GroupedSelect') {\n bindGroupedSelectToNya();\n } \n if ($scope.nyaSelect.selectedControl === 'Radio') {\n bindRadioToNya();\n } \n //save config to control\n controllerModalProxy.applyConfigToSelectedControl($scope.nyaSelect);\n //return current model to parent controller :\n $modalInstance.close($scope.nyaSelect);\n }\n\n function cancelfct() {\n $modalInstance.dismiss('cancel');\n } \n\n\n\n\n\n\n\n function bindRadioFromNYA(){\n if ($scope.nyaSelect.temporyConfig.formlyOptions.length > 0) {\n for (var i = 0; i <= $scope.nyaSelect.temporyConfig.formlyOptions.length-1; i++){\n var newOption = {\n 'option': $scope.nyaSelect.temporyConfig.formlyOptions[i].name,\n 'order': i,\n 'group': ''\n };\n $scope.radioRowCollection.rows.push(newOption);\n } \n }\n }\n\n function bindRadioToNya(){\n var resetNyASelectOptions = [];\n $scope.nyaSelect.temporyConfig.formlyOptions = resetNyASelectOptions;\n if ($scope.radioRowCollection.rows.length > 0) {\n for (var i = 0; i <= $scope.radioRowCollection.rows.length - 1; i++){\n var newOption = {\n 'name': $scope.radioRowCollection.rows[i].option,\n 'value': i,\n 'group': ''\n };\n $scope.nyaSelect.temporyConfig.formlyOptions.push(newOption); \n } \n }\n }\n\n function bindBasicSelectFromNYA(){\n if ($scope.nyaSelect.temporyConfig.formlyOptions.length > 0) {\n for (var i = 0; i <= $scope.nyaSelect.temporyConfig.formlyOptions.length-1; i++){\n var newOption = {\n 'option': $scope.nyaSelect.temporyConfig.formlyOptions[i].name,\n 'order': i,\n 'group': ''\n };\n $scope.basicSelectRowCollection.rows.push(newOption);\n } \n }\n }\n\n function bindBasicSelectToNya(){\n var resetNyASelectOptions = [];\n $scope.nyaSelect.temporyConfig.formlyOptions = resetNyASelectOptions;\n if ($scope.basicSelectRowCollection.rows.length > 0) {\n for (var i = 0; i <= $scope.basicSelectRowCollection.rows.length - 1; i++){\n var newOption = {\n 'name': $scope.basicSelectRowCollection.rows[i].option,\n 'value': i,\n 'group': ''\n };\n $scope.nyaSelect.temporyConfig.formlyOptions.push(newOption);\n } \n }\n } \n\n function bindGroupedSelectFromNYA(){\n if ($scope.nyaSelect.temporyConfig.formlyOptions.length > 0) {\n for (var i = 0; i <= $scope.nyaSelect.temporyConfig.formlyOptions.length-1; i++){\n var newOption = {\n 'option': $scope.nyaSelect.temporyConfig.formlyOptions[i].name,\n 'order': i,\n 'group': $scope.nyaSelect.temporyConfig.formlyOptions[i].group\n };\n $scope.groupedSelectRowCollection.rows.push(newOption); \n }\n //grouplist : thx to lodash it is easy\n var filteredgroup = _.uniq(_.pluck($scope.groupedSelectRowCollection.rows, 'group'));\n angular.copy(filteredgroup, $scope.GroupedSelectGroups.list); \n }\n }\n\n function bindGroupedSelectToNya(){\n $scope.nyaSelect.temporyConfig.formlyOptions = [];\n for (var i = 0; i <= $scope.groupedSelectRowCollection.rows.length - 1; i++){\n var newOption = {\n 'name': $scope.groupedSelectRowCollection.rows[i].option,\n 'value': i,\n 'group': $scope.groupedSelectRowCollection.rows[i].group\n };\n $scope.nyaSelect.temporyConfig.formlyOptions.push(newOption); \n }\n } \n\n function initDatePicker(){\n $scope.nyaSelect.temporyConfig.datepickerPopup = $scope.demodt.formats[0]; \n } \n\n function initNyaSelectConformingSelectedControl(){\n //place nya-select to selection if not none :\n if (nyaSelect.selectedControl !== 'none') {\n for (var i = $scope.nyaSelect.controls.length - 1; i >= 0; i--) {\n if ($scope.nyaSelect.controls[i].id === nyaSelect.selectedControl) {\n $scope.modelNyaSelect = nyaSelect.controls[i];\n }\n }\n if ($scope.nyaSelect.selectedControl === 'BasicSelect') {\n bindBasicSelectFromNYA();\n }\n if ($scope.nyaSelect.selectedControl === 'GroupedSelect') {\n bindGroupedSelectFromNYA();\n } \n if ($scope.nyaSelect.selectedControl === 'Radio') {\n bindRadioFromNYA();\n } \n }\n }\n\n function resetTemporyConfig(){\n $scope.nyaSelect.temporyConfig = {\n formlyLabel: '', \n formlyRequired: false, \n formlyPlaceholder: '',\n formlyDesciption: '',\n formlyOptions: []\n }; \n }\n\n\n }\n\n\n})(); \n/**\n * ------------------------------------------------------\n * easy form generator directive (Step way)\n * ------------------------------------------------------\n * \n * all easy form generator embeded in a directive\n * \n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n;(function(){\n\t'use strict';\n\t\n\tangular\n\t\t.module('ngwfApp.directives.edaStepWayEasyFormGenDirective', [])\n\t\t.directive('edaStepWayEasyFormGen', edaStepWayEasyFormGen);\n\t\t\n\t\tedaStepWayEasyFormGen.$inject = [\n '$templateCache', \n '$timeout', \n 'formFieldManage',\n 'controllerModalProxy'];\n\t\t\n\t\tfunction edaStepWayEasyFormGen(\n $templateCache, \n $timeout, \n formFieldManage,\n controllerModalProxy){\n \n /**\n * directive's controller injection is here (before return directive) = to avoid minification errors\n * sad but true... -> this reminds me something?!\n */\n edaStepWayEasyFormGenCtrl.$inject = [\n \"$scope\", \n '$templateCache',\n 'easyFormGenVersion',\n '$filter',\n '$anchorScroll',\n 'toaster', \n '$timeout',\n '$modal',\n '$log', \n 'formFieldManage',\n 'controllerModalProxy',\n ];\n \n \n\t\t\tvar directive = {\n\t\t\t\trestrict : 'E',\n\t\t\t\tscope : {\n edaEasyFormGeneratorModel : '=',\n edaSaveFormEvent : '&edaSaveFormEvent'\n },\n\t\t\t\tcontroller : edaStepWayEasyFormGenCtrl,\n\t\t\t\tcontrollerAs : 'vm',\n\t\t\t\t//bindToController : true, //angular < 1.4, activating this property will break databindings\n\t\t\t\treplace : false,\n\t\t\t\ttemplateUrl : 'edaStepWayEasyFormGeneratorTemplate.html',\n\t\t\t\tlink : linkFct\n\t\t\t};\n\t\t\treturn directive;\n\t\t\t\n\t\t\tfunction linkFct(scope, element, attrs){\n \n //watch \"scope.easyFormGeneratorModel\"\n scope.$watch(watchEdaEasyFormModelExpression, \n watchEdaEasyFormModelHasChanged, \n true); \n \n //watch \"scope.returnSaveEvent\"\" = catch saving form event \n\t\t\t\t\tscope.$watch(watchReturnSaveEventExpression, \n watchReturnSaveEventhasChanged);\t\n \n \n \n \n \n \n \n \n \n \n function returnAttributeConfigurationLinesIfNotEmpty(){\n var edaEasyFormGeneratorModelToReturn = (\n angular.isArray(scope.edaEasyFormGeneratorModel.edaFieldsModel) ? ( \n scope.edaEasyFormGeneratorModel.edaFieldsModel.length > 0 ? \n scope.edaEasyFormGeneratorModel.edaFieldsModel \n : emptyEdaFieldsModel()\n ) \n : emptyEdaFieldsModel()\n );\n return edaEasyFormGeneratorModelToReturn; \n }\n \n /**\n * empty fields model : to display at least an empty line\n * otherwise would look like ugly empty line like it were a bug\n */\n\t\t\t\t\tfunction emptyEdaFieldsModel(){\n\t\t\t\t\t\tvar emptyModel = [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"line\": 1,\n\t\t\t\t\t\t\t\t\"activeColumn\": 1,\n\t\t\t\t\t\t\t\t\"columns\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"numColumn\": 1,\n\t\t\t\t\t\t\t\t\t\t\"exist\": true,\n\t\t\t\t\t\t\t\t\t\t\"control\": {\n\t\t\t\t\t\t\t\t\t\t\t\"type\": \"none\",\n\t\t\t\t\t\t\t\t\t\t\t\"key\": \"none\"\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t];\n\t\t\t\t\t\treturn emptyModel;\n\t\t\t\t\t}\n \n function returnAttributeDataModelIfNotEmpty(){\n var dataModelToReturn = (\n angular.isArray(scope.edaEasyFormGeneratorModel.dataModel) ? ( \n scope.edaEasyFormGeneratorModel.dataModel.length > 0 ? \n scope.edaEasyFormGeneratorModel.dataModel \n : []\n ) \n : []\n );\n return dataModelToReturn; \n } \n \n function watchEdaEasyFormModelExpression(){\n return scope.edaEasyFormGeneratorModel;\n }\n \n function watchEdaEasyFormModelHasChanged(newValue, oldValue){ \n loadExistingConfigurationModel(); \n } \n \n \n \n function watchReturnSaveEventExpression(){\n return scope.returnSaveEvent;\n }\n \n function watchReturnSaveEventhasChanged(newValue, oldValue){\n if (newValue === true) {\n var _easyFormGeneratorModel = {\n formName : scope.configuration.formName,\n btnSubmitText : scope.configuration.submitButtonText,\n btnCancelText : scope.configuration.cancelButtonText,\n edaFieldsModel : scope.configuration.lines,\n //just as test\n \n edaFieldsModelStringified : angular.toJson(scope.configuration.lines),\n \n formlyFieldsModel : scope.vm.wfFormFieldsOnlyNeededProperties,\n dataModel : scope.vm.model\n };\n scope.edaSaveFormEvent({\n edaEasyFormGeneratorModel : _easyFormGeneratorModel\n });\n //back to false, waiting next save event\n scope.returnSaveEvent = false;\n } \n\t\t\t } \n \n \n function loadExistingConfigurationModel(){\n \n if(angular.isDefined(scope.edaEasyFormGeneratorModel)){\n var configlines = returnAttributeConfigurationLinesIfNotEmpty(); \n scope.configurationLoaded = {};\n \n formFieldManage.bindConfigurationLines(scope.configurationLoaded,configlines);\n /**\n * rebind special control properties :\n * \n * formly expression properties\n * Validators\n * Validation\n */\n controllerModalProxy.refreshControlFormlyExpressionProperties(scope.configurationLoaded);\n controllerModalProxy.refreshControlFormlyValidators(scope.configurationLoaded);\n controllerModalProxy.refreshControlFormlyValidation(scope.configurationLoaded);\n \n //apply configuration model\n scope.configuration = angular.copy(scope.configurationLoaded);\n \n //apply formly model\n formFieldManage.applyConfigurationToformlyModel(scope.configurationLoaded, scope.vm.wfFormFields, scope.vm.model); \n \n scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy(scope.vm.wfFormFields);\n scope.vm.model = returnAttributeDataModelIfNotEmpty; \n scope.configuration.formName = angular.isString(scope.edaEasyFormGeneratorModel.formName) ? scope.edaEasyFormGeneratorModel.formName : '';\n scope.configuration.submitButtonText = angular.isString(scope.edaEasyFormGeneratorModel.btnSubmitText) ? scope.edaEasyFormGeneratorModel.btnSubmitText : 'Submit'; \n scope.configuration.cancelButtonText = angular.isString(scope.edaEasyFormGeneratorModel.btnCancelText) ? scope.edaEasyFormGeneratorModel.btnCancelText : 'Cancel';\n } \n } \n \n \n \n \n \n \n \n \n \n\t\t\t}\n\t\t\t \n function edaStepWayEasyFormGenCtrl(\n $scope, \n $templateCache,\n easyFormGenVersion,\n $filter,\n $anchorScroll,\n toaster,\n $timeout, \n $modal,\n $log, \n formFieldManage, \n controllerModalProxy\n ){\n /*jshint validthis: true */\n $scope.vm = this;\n $scope.vm.model = {};\n $scope.vm.wfFormFields = [];\n $scope.vm.wfFormFieldsOnlyNeededProperties = []; \n $scope.vm.onSubmit = onSubmit;\n\n $scope.easyFormGeneratorVERSION = easyFormGenVersion;\n $scope.debug = initDebugModel();\n $scope.tab = initTabModel();\n\n //configuration model (contains array of lines which contains array of columns)\n $scope.configuration = {}; \n \n $scope.numberOfColumns = 1;\n $scope.MaxNumberOfColumns = 3;\n $scope.MinNumberOfColumns = 1;\n $scope.columnTemplate = initColumnTemplate();\n\n $scope.lineTemplate = initLineTemplate();\n $scope.resetToZeroModel = resetToZeroModel;\n $scope.countConfigurationModelLines = countConfigurationModelLines;\n $scope.setActiveLineNumber = setActiveLineNumber;\n $scope.upThisLine = upThisLine;\n $scope.downThisLine = downThisLine;\n $scope.addNewline = addNewline;\n $scope.removeThisLine = removeThisLine;\n\n $scope.increaseNumberOfColumns = increaseNumberOfColumns;\n $scope.decreaseNumberOfColumns = decreaseNumberOfColumns;\n\n $scope.resetStepCounter = resetStepCounter;\n $scope.nextConfigStep = nextConfigStep;\n\n $scope.previousConfigStep = previousConfigStep;\n $scope.stepReachable = stepReachable;\n\n $scope.toggleAnimation = toggleAnimation;\n\n $scope.nyaSelect = {};\n \n $scope.animationsEnabled = true;\n //call modal to edit selected control\n $scope.showModalAddCtrlToColumn = showModalAddCtrlToColumn;\n\n \n $scope.formlyList = {};\n $scope.previewLoadedForm = { fieldsModel:[] };\n $scope.configurationLoaded = {}; \n $scope.previewExistingform = previewExistingform;\n $scope.saveThisForm = saveThisForm; //should save to database (commented here)\n $scope.returnSaveEvent = false;\n\n\n \n\n\n \n\n formFieldManage.initConfigurationEditFromScratch($scope.configuration);\n\n controllerModalProxy.initNyaSelect($scope.nyaSelect);\n\n\n\n function initDebugModel(){\n return {\n showDebug : false,\n configurationModelNumberofLines : 1 \n };\n }\n\n function initTabModel(){\n return {\n editTab : {active : true},\n previewTab : {active : false}\n };\n }\n\n function previewExistingform(formlyform){\n var configlines = JSON.parse(formlyform.formlyField);\n //here to replace with $scope.configuration : initialise configuration with lines \n $scope.configurationLoaded = {};\n formFieldManage.bindConfigurationLines($scope.configurationLoaded,configlines);\n formFieldManage.applyConfigurationToformlyModel($scope.configurationLoaded, $scope.previewLoadedForm.fieldsModel, $scope.vm.model);\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields);\n $scope.previewLoadedForm.cancelButtonText = formlyform.cancelButtonText;\n $scope.previewLoadedForm.submitButtonText = formlyform.submitButtonText;\n } \n\n function onSubmit() {\n toaster.pop({\n type: 'info',\n timeout:2000,\n title: 'should save data model if it were not a static example',\n body: 'data :' + $filter('json')($scope.vm.model, 4), \n showCloseButton: true\n }); \n }\n \n function initColumnTemplate(){\n return {\n numColumn: -1,\n exist:true, \n control: {\n type:'none',\n key: 'none',\n subtype: 'none',\n // templateOptions: {\n // label: 'none',\n // placeholder: 'none',\n // required: false,\n // description: 'Descriptive text'\n // }\n } \n };\n }\n\n function initLineTemplate(){\n return {\n line:-1, \n activeColumn : 1,\n columns: [\n { \n numColumn: 1,\n exist:true, \n control: {\n type:'none',\n key: 'none',\n // templateOptions: {\n // label: 'none',\n // placeholder: 'none',\n // required: false,\n // description: 'Descriptive text'\n // }\n }\n }\n ]\n };\n }\n\n function resetToZeroModel(){\n $scope.configuration.activeLine = 1;\n if ($scope.configuration.lines.length > 1) {\n $scope.configuration.lines.splice(1, $scope.configuration.lines.length - 2);\n }\n return $scope.countConfigurationModelLines();\n }\n\n function countConfigurationModelLines(){\n //information in debug model\n $scope.debug.configurationModelNumberofLines = $scope.configuration.lines.length;\n return $scope.configuration.lines.length;\n } \n\n function setActiveLineNumber(lineNumber){\n if (lineNumber <= $scope.countConfigurationModelLines()) {\n $scope.configuration.activeLine = lineNumber;\n }\n } \n\n function upThisLine(indexLine){ \n if (indexLine > -1) {\n if ($scope.configuration.lines[indexLine - 1]) {\n var currentLineObj = $scope.configuration.lines[indexLine];\n $scope.configuration.lines.splice(indexLine , 1);\n $scope.configuration.lines.splice((indexLine - 1), 0, currentLineObj); \n //manage selected aciveLine\n $scope.configuration.activeLine = 1;\n }\n }\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model);\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields); \n } \n\n function downThisLine(indexLine){\n if (indexLine > -1) {\n if ($scope.configuration.lines[indexLine + 1]) {\n var currentLineObj = $scope.configuration.lines[indexLine];\n $scope.configuration.lines.splice(indexLine , 1);\n $scope.configuration.lines.splice((indexLine + 1), 0, currentLineObj); \n //manage selected aciveLine\n $scope.configuration.activeLine = 1;\n }\n } \n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model); \n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields); \n } \n\n function addNewline(){\n $scope.configuration.lines.push(\n {\n line:-1, \n activeColumn : 1,\n columns: [\n { \n numColumn: 1,\n exist:true, \n control: {\n type:'none',\n key: 'none',\n // templateOptions: {\n // label: 'none',\n // placeholder: 'none',\n // required: false,\n // description: 'Descriptive text'\n // }\n }\n }\n ]\n }\n );\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model);\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields); \n }\n\n function removeThisLine(index){\n if (index > -1) {\n if ($scope.configuration.lines.length > 1) {\n //manage selected aciveLine\n if ($scope.configuration.activeLine === index + 1) {\n $scope.configuration.activeLine = 1;\n }\n $scope.configuration.lines.splice(index, 1);\n }else{\n $timeout(function(){\n toaster.pop({\n type: 'warning',\n title: 'Last line' ,\n body: 'Can\\'t delete the last line', \n showCloseButton: true\n });\n }, 100); \n }\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model);\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields);\n }\n }\n\n function increaseNumberOfColumns(){\n if ($scope\n .configuration\n .lines[$scope.configuration.activeLine -1]\n .columns.length < $scope.MaxNumberOfColumns) {\n\n var newNumberOfColumns = $scope\n .configuration\n .lines[$scope.configuration.activeLine -1]\n .columns\n .push(\n {\n numColumn: -1,\n exist: true, \n control: {\n type:'none',\n key: 'none'\n // templateOptions: {\n // label: 'none',\n // placeholder: 'none',\n // required: false,\n // description: 'Descriptive text'\n // }\n } \n } \n );\n $scope\n .configuration\n .lines[$scope.configuration.activeLine -1]\n .columns[newNumberOfColumns - 1]\n .numColumn = newNumberOfColumns; \n }\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model); \n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields);\n } \n\n function decreaseNumberOfColumns(){\n if ($scope\n .configuration\n .lines[$scope.configuration.activeLine -1]\n .columns.length > 1) {\n $scope.configuration\n .lines[$scope.configuration.activeLine -1]\n .columns\n .splice($scope.configuration.lines[$scope.configuration.activeLine -1].columns.length -1, 1);\n }\n //re-render formfield \n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model); \n\n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields); \n } \n\n function resetStepCounter(){\n $scope.configuration.configStepCounter = 0;\n } \n\n function nextConfigStep(){\n var configStepCounterMAX = $scope.configuration.listConfigStep.length -1;\n if ($scope.configuration.configStepCounter !== configStepCounterMAX) {\n $scope.configuration.configStepCounter ++;\n } \n setTrueThisStepIndicator($scope.configuration.configStepCounter);\n } \n\n function previousConfigStep(){\n if ($scope.configuration.configStepCounter !== 0) {\n $scope.configuration.configStepCounter --;\n }\n setTrueThisStepIndicator($scope.configuration.configStepCounter);\n }\n\n function stepReachable(indexStep){\n if (indexStep < $scope.configuration.configStepCounter) {\n return 'disabled';\n }else{\n return 'enabled';\n }\n } \n\n function showModalAddCtrlToColumn(size, indexLine, numcolumn) {\n\n var modalInstance = $modal.open({\n animation: $scope.animationsEnabled,\n templateUrl: 'editModalTemplate.html', \n controller: 'ngwfWfEditMODALController',\n size: 'lg',\n resolve: {\n nyaSelect: function () {\n return controllerModalProxy\n .getNyASelectFromSelectedLineColumn($scope.nyaSelect, $scope.configuration,indexLine, numcolumn);\n }\n }\n });\n\n modalInstance.result.then(function (modalAddCtrlModel) {\n controllerModalProxy.bindConfigurationModelFromModalReturn(indexLine, numcolumn, modalAddCtrlModel, $scope.configuration);\n formFieldManage.applyConfigurationToformlyModel($scope.configuration, $scope.vm.wfFormFields, $scope.vm.model);\n \n $scope.vm.wfFormFieldsOnlyNeededProperties = angular.copy($scope.vm.wfFormFields);\n\n }, function () {\n //$log.info('Modal dismissed at: ' + new Date());\n });\n } \n\n function toggleAnimation() {\n $scope.animationsEnabled = !$scope.animationsEnabled;\n } \n\n\n /**\n * saveThisForm \n * - SAVE to database (current stringified configuration model === current form)\n */\n function saveThisForm(){\n if (typeof $scope.configuration.formName === 'undefined') {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: 'Form name is undefined',\n body: 'Form has not been saved.', \n showCloseButton: true\n });\n return false;\n }\n if ($scope.configuration.formName === '') {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: 'Form name is required',\n body: 'Form has not been saved.', \n showCloseButton: true\n });\n return false;\n }\n toaster.pop({\n type: 'wait',\n timeout:10000,\n title: 'Form is being saved',\n body: 'Wait.', \n showCloseButton: true\n });\n\n \n toaster.clear(); \n \n\n $scope.returnSaveEvent = true;\n return true;\n } \n\n\n\n\n function resetAllIndicators(){\n for (var i = $scope.configuration.stepIndicators.length - 1; i >= 0; i--) {\n $scope.configuration.stepIndicators[i] = false;\n }\n }\n \n function setTrueThisStepIndicator(indexIndicator){\n resetAllIndicators();\n $scope.configuration.stepIndicators[indexIndicator] = true; \n }\n\n }\t\t\t\n\t\t\t\n\t\t}\n\t\t\n})();\n\n/**\n * ------------------------------------------------------\n * directives container\n * ------------------------------------------------------\n *\n * \n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n;(function () {\n\t'use strict';\n\t\n\tangular\n\t\t.module('ngwfApp.directives', [\t\n\t\t\t'ngwfApp.directives.ngwfStRatioDirective',\n\t\t\t'ngwfApp.directives.edaStepWayEasyFormGenDirective' \n\t\t\t]);\n\n})(); \n\n\n\n/**\n * ------------------------------------------------------\n * simple directive to set width style attribute in %\n * ------------------------------------------------------\n *\n * \n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n\n;(function () {\n\t\n\t'use strict';\n\n\tangular\n\t\t.module('ngwfApp.directives.ngwfStRatioDirective', [])\n\t\t.directive('stRatio', stRatio);\n\n\t\tstRatio.$inject = [];\n\t\tfunction stRatio(){\n\n\t\t\tvar directive = {\n\t\t\t\tlink : linkfct\n\t\t\t};\n\n\t\t\treturn directive;\n\n\t\t\tfunction linkfct(scope, element, attr){\n\t\t\t\tvar ratio=+(attr.stRatio);\n\t\t\t element.css('width',ratio+'%');\n\t\t\t}\n\n\t\t}\n\n})(); \n\n\n\n\n/**\n * ------------------------------------------------------\n * service : controllerModalProxy\n * ------------------------------------------------------\n *\n * service dedicated to - edit control - (controller modal proxy)\n * \n * ——————————————————————————————————————————————\n * MIT (2015) - Erwan Datin (MacKentoch)\n * https://github.com/MacKentoch/easyFormGenerator\n * ——————————————————————————————————————————————\n**/\n(function () {\n\t'use strict';\n\n\n\tangular\n\t\t.module('ngwfApp.services.ngwfEditCtrlControllerModalProxy', [])\n\t\t.factory('controllerModalProxy', controllerModalProxy);\n\n\t\tcontrollerModalProxy.$inject = [];\n\t\tfunction controllerModalProxy(){\n\t\t\t\n\t\t\tvar service = {\n\t\t\t\tinitNyaSelect \t\t\t\t\t\t\t\t\t\t\t\t\t: initNyaSelect,\n\t\t\t\tgetNyASelectFromSelectedLineColumn \t\t\t: getNyASelectFromSelectedLineColumn,\n\t\t\t\tbindConfigurationModelFromModalReturn \t: bindConfigurationModelFromModalReturn,\n\t\t\t\tapplyConfigToSelectedControl \t\t\t\t\t\t: applyConfigToSelectedControl,\n\t\t\t\tresetTemporyConfig \t\t\t\t\t\t\t\t\t\t\t: resetTemporyConfig,\n\t\t\t\tgetControlsDefinition \t\t\t\t\t\t\t\t\t: getControlsDefinition,\n\t\t\t\trefreshControlFormlyExpressionProperties: refreshControlFormlyExpressionProperties,\n\t\t\t\trefreshControlFormlyValidators\t\t\t\t\t: refreshControlFormlyValidators,\n\t\t\t\trefreshControlFormlyValidation\t\t\t\t\t: refreshControlFormlyValidation,\n\t\t\t};\n\t\t\t\n\t\t\treturn service;\n\n\n\t\t\tfunction initNyaSelect(nyaSelectObj){\n\t\t\t\treturn resetNyaSelect(nyaSelectObj);\n\t }\n\n\t\t\t/**\n\t\t\t * get all controls definition (nyaSelectObj)\n\t\t\t * \n\t\t\t * needed to bind these properties :\n\t\t\t * \n\t\t\t * formlyExpressionProperties: {}, \n\t\t\t * formlyValidators: {},\n\t\t\t * formlyValidation \t\t\n\t\t\t */\n\t\t\tfunction getControlsDefinition(){\n\t\t\t\tvar controls = {};\n\t\t\t\tresetNyaSelect(controls);\t\n\t\t\t\treturn controls;\n\t\t\t}\n\t\t\t\n\t\t\t/**\n\t\t\t * loading forms will not be able to retrieve formlyExpressionProperties\n\t\t\t * -> here does the job\n\t\t\t */\n\t\t\tfunction refreshControlFormlyExpressionProperties(configurationModel){\n\t\t\t\t\n\t\t\t\tif (angular.isObject(configurationModel)) {\n\t\t\t\t\t//iterates lines\n\t\t\t\t\tangular.forEach(configurationModel.lines, function(line, indexLine){\n\t\t\t\t\t\tangular.forEach(line.columns, function(column, controlIndex){\n\t\t\t\t\t\t\tvar _controlsDefinition = getControlsDefinition();\n\t\t\t\t\t\t\tangular.forEach(_controlsDefinition.controls, function(aControl, aControlIndex){\n\t\t\t\t\t\t\t\tif (column.control.type === aControl.formlyType &&\n\t\t\t\t\t\t\t\t\t\tcolumn.control.subtype === aControl.formlySubtype) {\n\t\t\t\t\t\t\t\t\t\t//----> update control formlyExpressionProperties property\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tcolumn.control.formlyExpressionProperties = aControl.formlyExpressionProperties;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t/**\n\t\t\t * loading forms will not be able to retrieve formlyValidators\n\t\t\t * -> here does the job\n\t\t\t */\t\t\t\n\t\t\tfunction refreshControlFormlyValidators(configurationModel){\n\t\t\t\t\n\t\t\t\tif (angular.isObject(configurationModel)) {\n\t\t\t\t\t//iterates lines\n\t\t\t\t\tangular.forEach(configurationModel.lines, function(line, indexLine){\n\t\t\t\t\t\tangular.forEach(line.columns, function(column, controlIndex){\n\t\t\t\t\t\t\tvar _controlsDefinition = getControlsDefinition();\n\t\t\t\t\t\t\tangular.forEach(_controlsDefinition.controls, function(aControl, aControlIndex){\n\t\t\t\t\t\t\t\tif (column.control.type === aControl.formlyType &&\n\t\t\t\t\t\t\t\t\t\tcolumn.control.subtype === aControl.formlySubtype) {\n\t\t\t\t\t\t\t\t\t\t//----> update control formlyValidators property\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tcolumn.control.formlyValidators = aControl.formlyValidators;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t/**\n\t\t\t * loading forms will not be able to retrieve formlyValidation\n\t\t\t * -> here does the job\n\t\t\t */\t\t\t\n\t\t\tfunction refreshControlFormlyValidation(configurationModel){\n\t\t\t\n\t\t\t\tif (angular.isObject(configurationModel)) {\n\t\t\t\t\t//iterates lines\n\t\t\t\t\tangular.forEach(configurationModel.lines, function(line, indexLine){\n\t\t\t\t\t\tangular.forEach(line.columns, function(column, controlIndex){\n\t\t\t\t\t\t\tvar _controlsDefinition = getControlsDefinition();\n\t\t\t\t\t\t\tangular.forEach(_controlsDefinition.controls, function(aControl, aControlIndex){\n\t\t\t\t\t\t\t\tif (column.control.type === aControl.formlyType &&\n\t\t\t\t\t\t\t\t\t\tcolumn.control.subtype === aControl.formlySubtype) {\n\t\t\t\t\t\t\t\t\t\t//----> update control formlyValidation property\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tcolumn.control.formlyValidation = aControl.formlyValidation;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t function getNyASelectFromSelectedLineColumn(nyaSelectObj, configurationObj, indexLine, numcolumn){\n\t resetNyaSelect(nyaSelectObj);\n\t /**\n\t * data send to modal controller \n\t */\n\t \n\t if (typeof configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions != 'undefined') {\n\n\t nyaSelectObj.temporyConfig.selectedControl \t\t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.selectedControl \t\t\t\t\t\t!= 'undefined' ? configurationObj.lines[indexLine].columns[numcolumn].control.selectedControl : 'none';\n\t nyaSelectObj.temporyConfig.formlyLabel \t\t\t\t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.label \t\t\t!= 'undefined' ? configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.label : '';\n\t nyaSelectObj.temporyConfig.formlyRequired \t\t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.required \t\t!= 'undefined' ? configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.required : '';\n\t nyaSelectObj.temporyConfig.formlyDesciption \t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.description != 'undefined' ? configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.description : '';\n\t nyaSelectObj.temporyConfig.formlyPlaceholder \t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.placeholder != 'undefined' ? configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.placeholder : '';\n\t nyaSelectObj.temporyConfig.formlyOptions \t\t\t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.options \t\t!= 'undefined' ? configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.options : '';\n\t\t\t\t\t\n\t\t\t\t\tnyaSelectObj.temporyConfig.formlyExpressionProperties = typeof configurationObj.lines[indexLine].columns[numcolumn].control.formlyExpressionProperties \t!= 'undefined' ? angular.copy(configurationObj.lines[indexLine].columns[numcolumn].control.formlyExpressionProperties) : {};\n\t\t\t\t\tnyaSelectObj.temporyConfig.formlyValidators \t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.formlyValidators \t\t\t\t\t\t\t\t\t\t!= 'undefined' ? angular.copy(configurationObj.lines[indexLine].columns[numcolumn].control.formlyValidators) : {};\n\t\t\t\t\tnyaSelectObj.temporyConfig.formlyValidation \t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.formlyValidation \t\t\t\t\t\t\t\t\t\t!= 'undefined' ? angular.copy(configurationObj.lines[indexLine].columns[numcolumn].control.formlyValidation) : {};\n\t\t\t\t\t\n\t\t\t\t\t/**\n\t\t\t\t\t * particular case : datepicker \n\t\t\t\t\t */\n\t if (nyaSelectObj.temporyConfig.selectedControl === 'Date') {\n\t \tnyaSelectObj.temporyConfig.datepickerPopup \t= typeof configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.datepickerPopup != 'undefined' ? configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.datepickerPopup : '';\n\t }\n\t }\n\t return nyaSelectObj;\t \t\n\t }\n\n\t function bindConfigurationModelFromModalReturn(indexLine, numcolumn, modalAddCtrlModel, configurationObj){\n\t\t\t\t\t \n\t var extractedProps = returnControlFromAddCtrlModalModel(modalAddCtrlModel);\n\t configurationObj.lines[indexLine].columns[numcolumn].control.selectedControl \t\t= extractedProps.selectedControl;\n\t configurationObj.lines[indexLine].columns[numcolumn].control.type \t\t\t\t\t\t\t= extractedProps.formlyType;\n\t configurationObj.lines[indexLine].columns[numcolumn].control.subtype \t\t\t\t\t\t= extractedProps.formlySubtype;\n\t //reset templateOptions\n\t configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions \t\t= {\n\t label: '',\n\t required: false,\n\t description: '',\n\t placeholder: '',\n\t options: []\n\t };\n\t //then bind templateOptions \n\t configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.label \t\t\t = extractedProps.formlyLabel;\n\t configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.required \t = extractedProps.formlyRequired;\n\t configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.description = extractedProps.formlyDesciption;\n\t configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.placeholder = extractedProps.formlyPlaceholder;\n\t configurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.options \t\t = extractedProps.formlyOptions;\n\n\t configurationObj.lines[indexLine].columns[numcolumn].control.formlyExpressionProperties = angular.copy(extractedProps.formlyExpressionProperties);\n\t configurationObj.lines[indexLine].columns[numcolumn].control.formlyValidators \t\t\t\t\t= angular.copy(extractedProps.formlyValidators);\n\t configurationObj.lines[indexLine].columns[numcolumn].control.formlyValidation \t\t\t\t\t= angular.copy(extractedProps.formlyValidation);\n\n\t\t \t//////////////////////////////////////////\n\t // add additionnal particular properties\n\t //////////////////////////////////////////\n\t //-> datepicker : datepickerPopup\n\t if (configurationObj.lines[indexLine].columns[numcolumn].control.type === 'datepicker') {\n\t \tconfigurationObj.lines[indexLine].columns[numcolumn].control.templateOptions.datepickerPopup = extractedProps.datepickerPopup;\n\t }\t\n\t /**\n\t * unique key (set only first time) in this model is formly control type + Date.now(); \n\t */\n\t var newKey = configurationObj.lines[indexLine].columns[numcolumn].control.type + '-' + Date.now();\n\n\t if (validKeyUniqueness(newKey, configurationObj) === true){\n\t configurationObj.lines[indexLine].columns[numcolumn].control.key = newKey;\n\t }else{\n\t \t/**\n\t \t * 2nd attempt \n\t \t */\n\t newKey = configurationObj.lines[indexLine].columns[numcolumn].control.type + '-' + Date.now();\n\n\t if (validKeyUniqueness(newKey, configurationObj) === true){\n\t configurationObj.lines[indexLine].columns[numcolumn].control.key = newKey;\n\t }else{\n\t \t/**\n\t \t * 2nd attempt \n\t \t */\n\t newKey = configurationObj.lines[indexLine].columns[numcolumn].control.type + '-' + Date.now();\n\t }\n\t } \n\t \tconfigurationObj.lines[indexLine].columns[numcolumn].control.edited = true;\n\t \t}\n\n\t \tfunction applyConfigToSelectedControl(nyaSelectObj){\n\t\t \t/**\n\t\t \t * used in modal (edit control) \n\t\t \t */\n\t\t for (var i = nyaSelectObj.controls.length - 1; i >= 0; i--) {\n\t\t if (nyaSelectObj.controls[i].id === nyaSelectObj.selectedControl) {\n\n\t\t nyaSelectObj.controls[i].formlyLabel \t\t\t\t\t\t\t\t= nyaSelectObj.temporyConfig.formlyLabel;\n\t\t nyaSelectObj.controls[i].formlyRequired \t\t\t\t\t\t= nyaSelectObj.temporyConfig.formlyRequired;\n\t\t nyaSelectObj.controls[i].formlyDesciption \t\t\t\t\t= nyaSelectObj.temporyConfig.formlyDesciption;\n\t\t nyaSelectObj.controls[i].formlyPlaceholder \t\t\t\t\t= nyaSelectObj.temporyConfig.formlyPlaceholder;\n\t\t nyaSelectObj.controls[i].formlyOptions \t\t\t\t\t\t\t= nyaSelectObj.temporyConfig.formlyOptions;\n\n\t\t if (nyaSelectObj.controls[i].id ==='Date' ) {\n\t\t \tnyaSelectObj.controls[i].datepickerPopup \t\t\t\t\t= nyaSelectObj.temporyConfig.datepickerPopup;\n\t\t }\n\t\t \n\t\t }\n\t\t }\n\t\t }\n\n\t\t function resetTemporyConfig(){\n\t\t return {\n\t formlyLabel: '', \n\t formlyRequired: false, \n\t formlyPlaceholder: '',\n\t formlyDesciption: '',\n\t formlyOptions: []\n\t }; \t\t \t\n\t\t }\n\n\n\n\t /**\n\t * init object : return true (if not true, you may have problem^^)\n\t */\n\t\t function resetNyaSelect(nyaSelectObj){\n\t\t var newNyaSelectObj = {\n\n\t\t controls : [\n\t\t {\n\t\t \tid: 'empty', \n\t\t \tname: 'no control', \n\t\t \tsubtitle: 'no control', \n\t\t \tgroup: 'Blank', \n\t\t \tformlyType: 'blank', \n\t\t \tformlySubtype: '', \n\t\t \tformlyLabel: '', \n\t\t \tformlyRequired: false, \n\t\t \tformlyDesciption: '', \n\t\t \tformlyOptions: [] , \n\t\t \tformlyExpressionProperties: {}, \n\t\t \tformlyValidators: {}, \n\t\t \tformlyValidation: {} \n\t\t },\n\n\t\t {id: 'Header', name: 'Header', subtitle: 'no control', group: 'Decoration', formlyType: 'header', formlySubtype: '', formlyLabel: '', formlyRequired: false, formlyDesciption: '', formlyOptions: [] , formlyExpressionProperties: {}, formlyValidators: {}, formlyValidation: {}},\n\t\t {id: 'Subtitle', name: 'Subtitle', subtitle: 'no control', group: 'Decoration', formlyType: 'subTitle', formlySubtype: '', formlyLabel: '', formlyRequired: false, formlyDesciption: '', formlyOptions: [] , formlyExpressionProperties: {}, formlyValidators: {}, formlyValidation: {}},\n\n\t\t {\n\t\t \tid: 'TextInput', \n\t\t \tname: 'Text input', \n\t\t \tsubtitle: 'Text input', \n\t\t \tgroup: 'input', \n\t\t \tformlyType: 'input', \n\t\t \tformlySubtype: '', \n\t\t \tformlyLabel: '', \n\t\t \tformlyRequired: false, \n\t\t \tformlyDesciption: '', \n\t\t \tformlyOptions: [] , \n\t\t \tformlyExpressionProperties: {}, \n\t\t \tformlyValidators: {}, \n\t\t \tformlyValidation: {\n\t\t\t\t\t\t \t\t messages: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t required: function(viewValue, modelValue, scope) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t//return a required validation message : \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t//-> '