!function(e){function r(e,r,o){return 4===arguments.length?t.apply(this,arguments):void n(e,{declarative:!0,deps:r,declare:o})}function t(e,r,t,o){n(e,{declarative:!1,deps:r,executingRequire:t,execute:o})}function n(e,r){r.name=e,e in p||(p[e]=r),r.normalizedDeps=r.deps}function o(e,r){if(r[e.groupIndex]=r[e.groupIndex]||[],-1==v.call(r[e.groupIndex],e)){r[e.groupIndex].push(e);for(var t=0,n=e.normalizedDeps.length;n>t;t++){var a=e.normalizedDeps[t],u=p[a];if(u&&!u.evaluated){var d=e.groupIndex+(u.declarative!=e.declarative);if(void 0===u.groupIndex||u.groupIndex=0;a--){for(var u=t[a],i=0;ia;a++){var d=t.importers[a];if(!d.locked)for(var i=0;ia;a++){var l,s=r.normalizedDeps[a],c=p[s],v=x[s];v?l=v.exports:c&&!c.declarative?l=c.esModule:c?(d(c),v=c.module,l=v.exports):l=f(s),v&&v.importers?(v.importers.push(t),t.dependencies.push(v)):t.dependencies.push(null),t.setters[a]&&t.setters[a](l)}}}function i(e){var r,t=p[e];if(t)t.declarative?c(e,[]):t.evaluated||l(t),r=t.module.exports;else if(r=f(e),!r)throw new Error("Unable to load dependency "+e+".");return(!t||t.declarative)&&r&&r.__useDefault?r["default"]:r}function l(r){if(!r.module){var t={},n=r.module={exports:t,id:r.name};if(!r.executingRequire)for(var o=0,a=r.normalizedDeps.length;a>o;o++){var u=r.normalizedDeps[o],d=p[u];d&&l(d)}r.evaluated=!0;var c=r.execute.call(e,function(e){for(var t=0,n=r.deps.length;n>t;t++)if(r.deps[t]==e)return i(r.normalizedDeps[t]);throw new TypeError("Module "+e+" not declared as a dependency.")},t,n);c&&(n.exports=c),t=n.exports,t&&t.__esModule?r.esModule=t:r.esModule=s(t)}}function s(r){if(r===e)return r;var t={};if("object"==typeof r||"function"==typeof r)if(g){var n;for(var o in r)(n=Object.getOwnPropertyDescriptor(r,o))&&h(t,o,n)}else{var a=r&&r.hasOwnProperty;for(var o in r)(!a||r.hasOwnProperty(o))&&(t[o]=r[o])}return t["default"]=r,h(t,"__useDefault",{value:!0}),t}function c(r,t){var n=p[r];if(n&&!n.evaluated&&n.declarative){t.push(r);for(var o=0,a=n.normalizedDeps.length;a>o;o++){var u=n.normalizedDeps[o];-1==v.call(t,u)&&(p[u]?c(u,t):f(u))}n.evaluated||(n.evaluated=!0,n.module.execute.call(e))}}function f(e){if(D[e])return D[e];if("@node/"==e.substr(0,6))return y(e.substr(6));var r=p[e];if(!r)throw"Module "+e+" not present.";return a(e),c(e,[]),p[e]=void 0,r.declarative&&h(r.module.exports,"__esModule",{value:!0}),D[e]=r.declarative?r.module.exports:r.esModule}var p={},v=Array.prototype.indexOf||function(e){for(var r=0,t=this.length;t>r;r++)if(this[r]===e)return r;return-1},g=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(m){g=!1}var h;!function(){try{Object.defineProperty({},"a",{})&&(h=Object.defineProperty)}catch(e){h=function(e,r,t){try{e[r]=t.value||t.get.call(e)}catch(n){}}}}();var x={},y="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&require.resolve&&"undefined"!=typeof process&&require,D={"@empty":{}};return function(e,n,o){return function(a){a(function(a){for(var u={_nodeRequire:y,register:r,registerDynamic:t,get:f,set:function(e,r){D[e]=r},newModule:function(e){return e}},d=0;d1)for(var d=1;d\n\t\n\t
\n\t\t \n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t
\t\t\t\t\t\t\n\n\t\t
\n\t
\n\n"; global.define = __define; return module.exports; }); $__System.register('4', [], function (_export) { /* global angular */ 'use strict'; var EMPTY_FIELD_MODEL, emptyEdaFieldsModel, returnAttributeDataModelIfNotEmpty, returnAttributeConfigurationLinesIfNotEmpty; return { setters: [], execute: function () { EMPTY_FIELD_MODEL = [{ 'line': 1, 'activeColumn': 1, 'columns': [{ 'numColumn': 1, 'exist': true, 'control': { 'type': 'none', 'key': 'none' } }] }]; /** * empty fields model : to display at least an empty line * otherwise would look like ugly empty line like it were a bug */ emptyEdaFieldsModel = function emptyEdaFieldsModel() { return angular.copy(EMPTY_FIELD_MODEL); }; returnAttributeDataModelIfNotEmpty = function returnAttributeDataModelIfNotEmpty(edaEasyFormGeneratorModel) { var dataModelToReturn = angular.isArray(edaEasyFormGeneratorModel.dataModel) ? edaEasyFormGeneratorModel.dataModel.length > 0 ? edaEasyFormGeneratorModel.dataModel : [] : []; return dataModelToReturn; }; returnAttributeConfigurationLinesIfNotEmpty = function returnAttributeConfigurationLinesIfNotEmpty(loadedFieldModel) { var edaEasyFormGeneratorModelToReturn = angular.isArray(loadedFieldModel) ? loadedFieldModel.length > 0 ? loadedFieldModel : emptyEdaFieldsModel() : emptyEdaFieldsModel(); return edaEasyFormGeneratorModelToReturn; }; _export('emptyEdaFieldsModel', emptyEdaFieldsModel); _export('returnAttributeDataModelIfNotEmpty', returnAttributeDataModelIfNotEmpty); _export('returnAttributeConfigurationLinesIfNotEmpty', returnAttributeConfigurationLinesIfNotEmpty); } }; }); $__System.register('5', ['3', '4', '6'], function (_export) { /* global angular */ 'use strict'; var easyFormViewerTemplate, returnAttributeConfigurationLinesIfNotEmpty, EASY_FORM_VIEWER_CONTROLLER, EASY_FORM_VIEWER_CONTROLLERAS, EASY_FORM_VIEWER_DIRECTIVE_NAME; function edaFormViewerDirective($modelsTranslator) { var directive = { restrict: 'E', scope: { edaEasyFormViewerDataModel: '=?', edaEasyFormViewerEasyFormGeneratorFieldsModel: '=?', edaEasyFormViewerSubmitButtonText: '@?', edaEasyFormViewerCancelButtonText: '@?', edaEasyFormViewerSubmitFormEvent: '&?', edaEasyFormViewerCancelFormEvent: '&?' }, replace: false, controller: EASY_FORM_VIEWER_CONTROLLER, controllerAs: EASY_FORM_VIEWER_CONTROLLERAS, template: easyFormViewerTemplate, link: linkFct }; return directive; function linkFct(scope) { scope.vm.model = {}; scope.vm.fields = loadFieldsModel(); scope.vm.submitText = scope.edaEasyFormViewerSubmitButtonText || 'Submit'; scope.vm.cancelText = scope.edaEasyFormViewerCancelButtonText || 'Cancel'; scope.$watch(fieldsModelToWatch, fieldsModelWatcher, true); scope.$watch(dataModelToWatch, dataModelWatcher, true); scope.$watch(submitBtnTextToWatch, submitBtnTextWatcher); scope.$watch(cancelBtnTextToWatch, cancelBtnTextWatcher); scope.$watch(submitEventToWatch, submitEventWatcher); scope.$watch(cancelEventToWatch, cancelEventWatcher); function dataModelToWatch() { return scope.vm.model; } function fieldsModelToWatch() { return scope.edaEasyFormViewerEasyFormGeneratorFieldsModel; } function submitBtnTextToWatch() { return scope.edaEasyFormViewerSubmitButtonText; } function cancelBtnTextToWatch() { return scope.edaEasyFormViewerCancelButtonText; } function submitEventToWatch() { return scope.vm.hasJustSumitted; } function cancelEventToWatch() { return scope.vm.hasJustCancelled; } function fieldsModelWatcher(newFieldsModel) { scope.vm.fields = loadExistingConfigurationModel(newFieldsModel); } function submitBtnTextWatcher(newSubmitBtntext, oldSubmitBtntext) { if (newSubmitBtntext !== oldSubmitBtntext) { scope.vm.submitText = newSubmitBtntext || 'Submit'; } } function cancelBtnTextWatcher(newCancelBtntext, oldCancelBtntext) { if (newCancelBtntext !== oldCancelBtntext) { scope.vm.cancelText = newCancelBtntext || 'Submit'; } } function dataModelWatcher(newDataModel) { scope.edaEasyFormViewerDataModel = newDataModel; } function submitEventWatcher(newSubmitEvent) { if (newSubmitEvent === true) { if (angular.isFunction(scope.edaEasyFormViewerSubmitFormEvent)) { var _dataModelSubmitted = scope.vm.model; scope.edaEasyFormViewerSubmitFormEvent({ dataModelSubmitted: _dataModelSubmitted }); } } scope.vm.hasJustSumitted = false; } function cancelEventWatcher(newCancelEvent) { if (newCancelEvent === true) { if (angular.isFunction(scope.edaEasyFormViewerCancelFormEvent)) { scope.edaEasyFormViewerCancelFormEvent(); } } scope.vm.hasJustCancelled = false; } /** * TODO : check if formly or easy form generato fields model * * by default or if both -> easy for generator is chosen */ function loadFieldsModel() { var initialFieldsModel = angular.isArray(scope.edaEasyFormViewerEasyFormGeneratorFieldsModel) ? //translate easy form generator to formly fields model loadExistingConfigurationModel(scope.edaEasyFormViewerEasyFormGeneratorFieldsModel) : {}; return initialFieldsModel; } function loadExistingConfigurationModel(loadedFieldModel) { if (angular.isArray(loadedFieldModel)) { var configlines = returnAttributeConfigurationLinesIfNotEmpty(loadedFieldModel); var formlyFieldsModel = []; scope.configurationLoaded = {}; $modelsTranslator.bindConfigurationLines(scope.configurationLoaded, configlines); /** * rebind special control properties : * * formly expression properties * Validators * Validation */ $modelsTranslator.refreshControlFormlyExpressionProperties(scope.configurationLoaded); $modelsTranslator.refreshControlFormlyValidators(scope.configurationLoaded); $modelsTranslator.refreshControlFormlyValidation(scope.configurationLoaded); //apply configuration model scope.configuration = angular.copy(scope.configurationLoaded); //apply formly model $modelsTranslator.applyConfigurationToformlyModel(scope.configurationLoaded, formlyFieldsModel, scope.vm.model); return formlyFieldsModel; } } } } return { setters: [function (_) { easyFormViewerTemplate = _['default']; }, function (_2) { returnAttributeConfigurationLinesIfNotEmpty = _2.returnAttributeConfigurationLinesIfNotEmpty; }, function (_3) { EASY_FORM_VIEWER_CONTROLLER = _3.EASY_FORM_VIEWER_CONTROLLER; EASY_FORM_VIEWER_CONTROLLERAS = _3.EASY_FORM_VIEWER_CONTROLLERAS; }], execute: function () { EASY_FORM_VIEWER_DIRECTIVE_NAME = 'edaEasyFormViewer'; edaFormViewerDirective.$inject = ['$modelsTranslator']; _export('default', edaFormViewerDirective); _export('EASY_FORM_VIEWER_DIRECTIVE_NAME', EASY_FORM_VIEWER_DIRECTIVE_NAME); } }; }); $__System.register('6', ['7', '8'], function (_export) { var _createClass, _classCallCheck, EASY_FORM_VIEWER_CONTROLLER, EASY_FORM_VIEWER_CONTROLLERAS, edaEasyFormViewerController; return { setters: [function (_) { _createClass = _['default']; }, function (_2) { _classCallCheck = _2['default']; }], execute: function () { 'use strict'; EASY_FORM_VIEWER_CONTROLLER = 'edaEasyFormViewerCtrl'; EASY_FORM_VIEWER_CONTROLLERAS = 'vm'; edaEasyFormViewerController = (function () { function edaEasyFormViewerController() { _classCallCheck(this, edaEasyFormViewerController); this.init(); } _createClass(edaEasyFormViewerController, [{ key: 'init', value: function init() { this.model = {}; this.fields = {}; this.hasJustSumitted = false; this.hasJustCancelled = false; } }, { key: 'edaSubmitThisDataModel', value: function edaSubmitThisDataModel() { this.hasJustSumitted = true; } }, { key: 'edaCancelEvent', value: function edaCancelEvent() { this.hasJustCancelled = true; } }]); return edaEasyFormViewerController; })(); edaEasyFormViewerController.$inject = []; _export('default', edaEasyFormViewerController); _export('EASY_FORM_VIEWER_CONTROLLER', EASY_FORM_VIEWER_CONTROLLER); _export('EASY_FORM_VIEWER_CONTROLLERAS', EASY_FORM_VIEWER_CONTROLLERAS); } }; }); $__System.register('9', ['5', '6'], function (_export) { /* global angular */ 'use strict'; var edaFormViewerDirective, EASY_FORM_VIEWER_DIRECTIVE_NAME, edaEasyFormViewerController, EASY_FORM_VIEWER_CONTROLLER, FORM_VIEWER_MAIN_MODULE_NAME; return { setters: [function (_) { edaFormViewerDirective = _['default']; EASY_FORM_VIEWER_DIRECTIVE_NAME = _.EASY_FORM_VIEWER_DIRECTIVE_NAME; }, function (_2) { edaEasyFormViewerController = _2['default']; EASY_FORM_VIEWER_CONTROLLER = _2.EASY_FORM_VIEWER_CONTROLLER; }], execute: function () { FORM_VIEWER_MAIN_MODULE_NAME = 'edaFormViewerMainModule'; _export('default', angular.module(FORM_VIEWER_MAIN_MODULE_NAME, []).directive(EASY_FORM_VIEWER_DIRECTIVE_NAME, edaFormViewerDirective).controller(EASY_FORM_VIEWER_CONTROLLER, edaEasyFormViewerController)); } }; }); $__System.register('a', [], function (_export) { 'use strict'; var CORE_MODULES, FORMVIEWER_CORE_MODULE_NAME; return { setters: [], execute: function () { CORE_MODULES = ['textAngular', 'formly', 'ngAnimate', 'formlyBootstrap', 'ui.bootstrap', 'nya.bootstrap.select']; FORMVIEWER_CORE_MODULE_NAME = 'edaEasyFormViewerCore.module'; _export('default', angular.module(FORMVIEWER_CORE_MODULE_NAME, CORE_MODULES)); } }; }); $__System.registerDynamic("b", [], true, function($__require, exports, module) { ; var global = this, __define = global.define; global.define = undefined; var $Object = Object; module.exports = { create: $Object.create, getProto: $Object.getPrototypeOf, isEnum: {}.propertyIsEnumerable, getDesc: $Object.getOwnPropertyDescriptor, setDesc: $Object.defineProperty, setDescs: $Object.defineProperties, getKeys: $Object.keys, getNames: $Object.getOwnPropertyNames, getSymbols: $Object.getOwnPropertySymbols, each: [].forEach }; global.define = __define; return module.exports; }); $__System.registerDynamic("c", ["b"], true, function($__require, exports, module) { ; var global = this, __define = global.define; global.define = undefined; var $ = $__require('b'); module.exports = function defineProperty(it, key, desc) { return $.setDesc(it, key, desc); }; global.define = __define; return module.exports; }); $__System.registerDynamic("d", ["c"], true, function($__require, exports, module) { ; var global = this, __define = global.define; global.define = undefined; module.exports = { "default": $__require('c'), __esModule: true }; global.define = __define; return module.exports; }); $__System.registerDynamic("7", ["d"], true, function($__require, exports, module) { "use strict"; ; var global = this, __define = global.define; global.define = undefined; var _Object$defineProperty = $__require('d')["default"]; exports["default"] = (function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; _Object$defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); exports.__esModule = true; global.define = __define; return module.exports; }); $__System.registerDynamic("8", [], true, function($__require, exports, module) { "use strict"; ; var global = this, __define = global.define; global.define = undefined; exports["default"] = function(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; exports.__esModule = true; global.define = __define; return module.exports; }); $__System.register('e', [], function (_export) { /* global angular */ 'use strict'; var resetNyaSelect, getConfigurationModelInit, getEmptyConfigModelResult, resetDataModel, getErrorObject, getMessageObject, resetFormlyModel, extractTemplateOptionDescription, extractTemplateOptionPlaceholder, extractTemplateOptionType, extractTemplateOptionLabel, extractTemplateOptionDatepickerOptions, extractFormlyExpressionProperties, extractFormlyValidators, extractFormlyValidation, extractTemplateOptionRequired, extractTemplateOptionOptions, addDatepickerOptionsProperty, addOneColumnHeader, addOneColumnControl, addTwoColumnControl, addThreeColumnControl; return { setters: [], execute: function () { resetNyaSelect = function resetNyaSelect(nyaSelectObj) { var newNyaSelectObj = { controls: [{ id: 'empty', name: 'no control', subtitle: 'no control', group: 'Blank', formlyType: 'blank', formlySubtype: '', formlyLabel: '', formlyRequired: false, formlyDesciption: '', formlyOptions: [], formlyExpressionProperties: {}, formlyValidators: {}, formlyValidation: {} }, { id: 'Header', name: 'Header', subtitle: 'no control', group: 'Decoration', formlyType: 'header', formlySubtype: '', formlyLabel: '', formlyRequired: false, formlyDesciption: '', formlyOptions: [], formlyExpressionProperties: {}, formlyValidators: {}, formlyValidation: {} }, { id: 'Subtitle', name: 'Subtitle', subtitle: 'no control', group: 'Decoration', formlyType: 'subTitle', formlySubtype: '', formlyLabel: '', formlyRequired: false, formlyDesciption: '', formlyOptions: [], formlyExpressionProperties: {}, formlyValidators: {}, formlyValidation: {} }, { id: 'TextInput', name: 'Text input', subtitle: 'Text input', group: 'input', formlyType: 'input', formlySubtype: '', formlyLabel: '', formlyRequired: false, formlyDesciption: '', formlyOptions: [], formlyExpressionProperties: {}, formlyValidators: {}, formlyValidation: { messages: { required: function required(viewValue, modelValue, scope) { //return a required validation message : //-> '