From 436b02b8ac64ff45bf75550c88518258f87d047f Mon Sep 17 00:00:00 2001 From: Artem Serebryakov Date: Fri, 11 Jan 2019 13:08:34 -0500 Subject: [PATCH] fix: removed disable form --- dist/ngx-forms.js | 2 +- src/app/containers/dynamic-form/dynamic-form.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/ngx-forms.js b/dist/ngx-forms.js index adb0ec4..ec7e59f 100644 --- a/dist/ngx-forms.js +++ b/dist/ngx-forms.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ngxForms=t():e.ngxForms=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=require("@angular/core")},function(e,t){e.exports=require("@angular/forms")},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(c=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(c))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var c;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r=0&&f.splice(t,1)}function h(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return y(t,e.attrs),m(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function b(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var c=s++;n=l||(l=h(t)),o=O.bind(null,n,c,!1),r=O.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),m(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=d(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var c=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(c),a&&URL.revokeObjectURL(a)}.bind(null,n,t),r=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=h(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){v(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=c()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return u(n,t),function(e){for(var o=[],r=0;r=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.components={}}return e.prototype.addField=function(e,t){if(!e||!e.length)throw new Error("Failed to add new component. Type is incorrent, Type value: "+e);if(!t)throw new Error("Failed to add new component. Component is undefined");this.components[e]=t},e.prototype.getField=function(e){if(!this.components[e]){var t=Object.keys(this.components).join(", ");throw new Error('Trying to use an unsupported field type "'+e+'". Supported types: '+t)}return this.components[e]},e=o([r.Injectable()],e)}();t.DynamicFieldService=i},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.selected=0,this.groups=[],this.watchers=[]}return e.prototype.add=function(e){var t=this;this.groups.push(e),this.groups.length>1&&(e.hidden=!0),this.watchers.forEach(function(e){return e.groups=t.groups})},e.prototype.select=function(e){this.groups.forEach(function(e){e.hidden=!0}),this.groups[e].hidden=!1,this.selected=e},e.prototype.reset=function(){this.groups.forEach(function(e){e.hidden=!1}),this.groups=[],this.selected=0},e.prototype.addWatcher=function(e){this.watchers.push(e)},e.prototype.getAllGroups=function(){return this.groups},e=o([r.Injectable()],e)}();t.FormNavService=i},function(e,t){e.exports=require("@angular/common")},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(14),a=n(16),l=n(18),s=n(23),f=n(25),d=n(27),u=n(29),p=n(31),m=n(4),v=function(){function e(e){this.dynamicFieldService=e,this.dynamicFieldService.addField("text",c.FormInputComponent),this.dynamicFieldService.addField("select",a.FormSelectComponent),this.dynamicFieldService.addField("editor",l.FormTextEditorComponent),this.dynamicFieldService.addField("textarea",d.FormTextareaComponent),this.dynamicFieldService.addField("hidden",u.FormInputHiddenComponent),this.dynamicFieldService.addField("radio",f.FormRadioComponent),this.dynamicFieldService.addField("checkbox",s.FormCheckboxComponent),this.dynamicFieldService.addField("label",p.FormLabelComponent)}var t;return e=o([i.Injectable(),r("design:paramtypes",["function"==typeof(t=void 0!==m.DynamicFieldService&&m.DynamicFieldService)?t:Object])],e)}();t.PreloadService=v,t.Components=[c.FormInputComponent,a.FormSelectComponent,l.FormTextEditorComponent,d.FormTextareaComponent,u.FormInputHiddenComponent,f.FormRadioComponent,s.FormCheckboxComponent,p.FormLabelComponent]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(9),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(10))},function(e,t){e.exports=require("reflect-metadata")},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(6),c=n(1),a=n(11),l=n(12),s=n(33),f=n(37),d=n(41),u=n(47),p=n(48),m=n(4);t.DynamicFieldService=m.DynamicFieldService;var v=n(7),h=function(){function e(){}return e=o([r.NgModule({imports:[i.CommonModule,p.BrowserAnimationsModule,c.ReactiveFormsModule,c.FormsModule,a.QuillModule,u.TagInputModule,d.FormNavModule],declarations:[v.Components,l.DynamicFieldDirective,s.DynamicFormComponent,f.DynamicPanelComponent],exports:[s.DynamicFormComponent],entryComponents:[v.Components],providers:[m.DynamicFieldService,v.PreloadService],schemas:[r.NO_ERRORS_SCHEMA]})],e)}();t.NgxFormModule=h},function(e,t){e.exports=require("ngx-quill")},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(1),a=n(13),l=n(4),s=n(7),f=function(){function e(e,t,n,o,r){this.resolver=e,this.container=t,this.dynamicFieldService=n,this.preloadService=o,this.fb=r}var t,n,f,d,u,p,m;return e.prototype.ngOnInit=function(){if(!this.group)throw new Error("group is not set");var e=this.dynamicFieldService.getField(this.field.type),t=this.resolver.resolveComponentFactory(e);this.component=this.container.createComponent(t),this.component.instance.field=this.field,this.component.instance.group=this.group,this.group.addControl(this.field.name,this.createControl(this.field)),this.model&&this.model[this.field.name]&&this.group.get(this.field.name).patchValue(this.model[this.field.name])},e.prototype.createControl=function(e){var t=e.disabled,n=e.required,o=e.minLength,r=e.maxLength,i=e.email,a=e.min,l=e.max,s=e.pattern,f=e.value,d=[];return void 0!==n&&n&&d.push(c.Validators.required),void 0!==o&&d.push(c.Validators.minLength(o)),void 0!==r&&d.push(c.Validators.maxLength(r)),void 0!==i&&d.push(c.Validators.email),void 0!==a&&d.push(c.Validators.min(a)),void 0!==l&&d.push(c.Validators.max(l)),void 0!==s&&d.push(c.Validators.pattern(s)),this.fb.control({disabled:t,value:f},d)},e.prototype.ngOnDestroy=function(){this.component&&this.component.destroy()},o([i.Input(),r("design:type","function"==typeof(t=void 0!==a.IFieldConfig&&a.IFieldConfig)?t:Object)],e.prototype,"field",void 0),o([i.Input(),r("design:type","function"==typeof(n=void 0!==c.FormGroup&&c.FormGroup)?n:Object)],e.prototype,"group",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"model",void 0),e=o([i.Directive({selector:"[dynamicField]"}),r("design:paramtypes",["function"==typeof(f=void 0!==i.ComponentFactoryResolver&&i.ComponentFactoryResolver)?f:Object,"function"==typeof(d=void 0!==i.ViewContainerRef&&i.ViewContainerRef)?d:Object,"function"==typeof(u=void 0!==l.DynamicFieldService&&l.DynamicFieldService)?u:Object,"function"==typeof(p=void 0!==s.PreloadService&&s.PreloadService)?p:Object,"function"==typeof(m=void 0!==c.FormBuilder&&c.FormBuilder)?m:Object])],e)}();t.DynamicFieldDirective=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-input",template:n(15)})],e)}();t.FormInputComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
\n'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-select",template:n(17)})],e)}();t.FormSelectComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.quillToolbar={toolbar:["bold","italic","underline","strike",{header:1},{header:2},{list:"ordered"},{list:"bullet"},"blockquote","code-block","link"]}}return e=o([r.Component({selector:"form-text-editor",template:n(19),styles:[n(20).toString()]})],e)}();t.FormTextEditorComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
'},function(e,t,n){var o=n(21);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(3)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(2)(!1)).push([e.i,"form-text-editor .editor-container {\n margin-bottom: 40px; }\n\nform-text-editor .ql-container.ql-disabled {\n background-color: #e9ecef; }\n",""])},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-checkbox",template:n(24)})],e)}();t.FormCheckboxComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
\n'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-radio",template:n(26)})],e)}();t.FormRadioComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-textarea",template:n(28)})],e)}();t.FormTextareaComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-hidden",template:n(30)})],e)}();t.FormInputHiddenComponent=i},function(e,t){e.exports='\n \n\n'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-label",template:n(32)})],e)}();t.FormLabelComponent=i},function(e,t){e.exports='
\n \n
\n {{group.value[this.field.name]}}\n
\n
'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(1),a=function(){function e(){}return Object.defineProperty(e.prototype,"changes",{get:function(){return this.form.valueChanges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.form.valid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.form.value},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.form=new c.FormGroup({}),this.form.disable();var t=[];this.formConfig.form.forEach(function(e){e.fields&&(t=t.concat(e.fields)),e.panels&&e.panels.forEach(function(e){e.fields&&(t=t.concat(e.fields))})}),t.forEach(function(t){if(t.lookup&&e.lookups){var n="string"==typeof t.lookup?{name:t.lookup,extract:null}:t.lookup;t.options=n.extract?e.lookups[n.name].map(function(e){return e[n.extract]}):e.lookups[n.name]}else;})},o([i.Input(),r("design:type",Object)],e.prototype,"formConfig",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"model",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"lookups",void 0),e=o([i.Component({exportAs:"dynamicForm",selector:"dynamic-form",template:n(34),styles:[n(35).toString()]})],e)}();t.DynamicFormComponent=a},function(e,t){e.exports='
\n
\n \n
\n
\n
\n\n \n \n \n\n \n \n \n
\n
\n
'},function(e,t,n){var o=n(36);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(3)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(2)(!1)).push([e.i,".required-icon {\n color: red; }\n",""])},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=function(){function e(){}return o([i.Input(),r("design:type",Object)],e.prototype,"panelConfig",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"group",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"model",void 0),e=o([i.Component({selector:"dynamic-panel",template:n(38),styles:[n(39).toString()]})],e)}();t.DynamicPanelComponent=c},function(e,t){e.exports='
\n
\n {{panelConfig.label}}\n
\n
\n
\n
\n
'},function(e,t,n){var o=n(40);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(3)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(2)(!1)).push([e.i,"dynamic-panel .panel {\n margin-bottom: 20px;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #ddd;\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); }\n dynamic-panel .panel .panel-heading {\n color: #333;\n background-color: #f5f5f5;\n padding: 10px 15px;\n border-bottom: 1px solid #ddd;\n border-top-left-radius: 3px;\n border-top-right-radius: 3px; }\n dynamic-panel .panel .panel-body {\n padding: 15px; }\n",""])},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(42),c=n(46),a=n(5),l=n(6),s=function(){function e(){}return e=o([r.NgModule({imports:[l.CommonModule],declarations:[i.FormNavComponent,c.NavDirective],exports:[i.FormNavComponent,c.NavDirective],providers:[a.FormNavService],schemas:[r.NO_ERRORS_SCHEMA]})],e)}();t.FormNavModule=s},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(5),a=n(1),l=function(){function e(e){this.ns=e,this.ref={groups:[]},this.subscriptions=[],e.addWatcher(this.ref)}var t,l;return e.prototype.ngAfterContentInit=function(){for(var e=this,t=(Object.keys(this.form.controls),function(t){var n=[];t.fields&&(n=n.concat(t.fields)),t.panels&&t.panels.forEach(function(e){e.fields&&(n=n.concat(e.fields))}),t.controls=n.map(function(t){return e.form.get(t.name)}),t.controls.forEach(function(n){e.subscriptions.push(n.statusChanges.subscribe(function(){t.valid=t.controls.every(function(e){return e.valid})}))})}),n=0,o=this.ref.groups;nthis.ref.groups.length-2},e.prototype.ngOnDestroy=function(){this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.ns.reset()},o([i.Input(),r("design:type","function"==typeof(t=void 0!==a.FormGroup&&a.FormGroup)?t:Object)],e.prototype,"form",void 0),e=o([i.Component({selector:"form-nav",template:n(43),styles:[n(44).toString()]}),r("design:paramtypes",["function"==typeof(l=void 0!==c.FormNavService&&c.FormNavService)?l:Object])],e)}();t.FormNavComponent=l},function(e,t){e.exports='\n
\n
\n
\n \n \n
\n
\n
'},function(e,t,n){var o=n(45);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(3)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(2)(!1)).push([e.i,"",""])},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(5),a=function(){function e(e){this.navService=e}var t;return e.prototype.ngOnInit=function(){this.panel.static||this.navService.add(this.panel)},o([i.Input("navTab"),r("design:type",Object)],e.prototype,"panel",void 0),e=o([i.Directive({selector:"[navTab]"}),r("design:paramtypes",["function"==typeof(t=void 0!==c.FormNavService&&c.FormNavService)?t:Object])],e)}();t.NavDirective=a},function(e,t){e.exports=require("ngx-chips")},function(e,t){e.exports=require("@angular/platform-browser/animations")}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ngxForms=t():e.ngxForms=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t){e.exports=require("@angular/core")},function(e,t){e.exports=require("@angular/forms")},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",o=e[3];if(!o)return n;if(t&&"function"==typeof btoa){var r=(c=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(c))))+" */"),i=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(i).concat([r]).join("\n")}var c;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r=0&&f.splice(t,1)}function h(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=function(){0;return n.nc}();o&&(e.attrs.nonce=o)}return y(t,e.attrs),m(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function b(e,t){var n,o,r,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var c=s++;n=l||(l=h(t)),o=O.bind(null,n,c,!1),r=O.bind(null,n,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),m(e,t),t}(t),o=function(e,t,n){var o=n.css,r=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(o=d(o));r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var c=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(c),a&&URL.revokeObjectURL(a)}.bind(null,n,t),r=function(){v(n),n.href&&URL.revokeObjectURL(n.href)}):(n=h(t),o=function(e,t){var n=t.css,o=t.media;o&&e.setAttribute("media",o);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){v(n)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=c()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return u(n,t),function(e){for(var o=[],r=0;r=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.components={}}return e.prototype.addField=function(e,t){if(!e||!e.length)throw new Error("Failed to add new component. Type is incorrent, Type value: "+e);if(!t)throw new Error("Failed to add new component. Component is undefined");this.components[e]=t},e.prototype.getField=function(e){if(!this.components[e]){var t=Object.keys(this.components).join(", ");throw new Error('Trying to use an unsupported field type "'+e+'". Supported types: '+t)}return this.components[e]},e=o([r.Injectable()],e)}();t.DynamicFieldService=i},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.selected=0,this.groups=[],this.watchers=[]}return e.prototype.add=function(e){var t=this;this.groups.push(e),this.groups.length>1&&(e.hidden=!0),this.watchers.forEach(function(e){return e.groups=t.groups})},e.prototype.select=function(e){this.groups.forEach(function(e){e.hidden=!0}),this.groups[e].hidden=!1,this.selected=e},e.prototype.reset=function(){this.groups.forEach(function(e){e.hidden=!1}),this.groups=[],this.selected=0},e.prototype.addWatcher=function(e){this.watchers.push(e)},e.prototype.getAllGroups=function(){return this.groups},e=o([r.Injectable()],e)}();t.FormNavService=i},function(e,t){e.exports=require("@angular/common")},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(14),a=n(16),l=n(18),s=n(23),f=n(25),d=n(27),u=n(29),p=n(31),m=n(4),v=function(){function e(e){this.dynamicFieldService=e,this.dynamicFieldService.addField("text",c.FormInputComponent),this.dynamicFieldService.addField("select",a.FormSelectComponent),this.dynamicFieldService.addField("editor",l.FormTextEditorComponent),this.dynamicFieldService.addField("textarea",d.FormTextareaComponent),this.dynamicFieldService.addField("hidden",u.FormInputHiddenComponent),this.dynamicFieldService.addField("radio",f.FormRadioComponent),this.dynamicFieldService.addField("checkbox",s.FormCheckboxComponent),this.dynamicFieldService.addField("label",p.FormLabelComponent)}var t;return e=o([i.Injectable(),r("design:paramtypes",["function"==typeof(t=void 0!==m.DynamicFieldService&&m.DynamicFieldService)?t:Object])],e)}();t.PreloadService=v,t.Components=[c.FormInputComponent,a.FormSelectComponent,l.FormTextEditorComponent,d.FormTextareaComponent,u.FormInputHiddenComponent,f.FormRadioComponent,s.FormCheckboxComponent,p.FormLabelComponent]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(9),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(10))},function(e,t){e.exports=require("reflect-metadata")},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(6),c=n(1),a=n(11),l=n(12),s=n(33),f=n(37),d=n(41),u=n(47),p=n(48),m=n(4);t.DynamicFieldService=m.DynamicFieldService;var v=n(7),h=function(){function e(){}return e=o([r.NgModule({imports:[i.CommonModule,p.BrowserAnimationsModule,c.ReactiveFormsModule,c.FormsModule,a.QuillModule,u.TagInputModule,d.FormNavModule],declarations:[v.Components,l.DynamicFieldDirective,s.DynamicFormComponent,f.DynamicPanelComponent],exports:[s.DynamicFormComponent],entryComponents:[v.Components],providers:[m.DynamicFieldService,v.PreloadService],schemas:[r.NO_ERRORS_SCHEMA]})],e)}();t.NgxFormModule=h},function(e,t){e.exports=require("ngx-quill")},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(1),a=n(13),l=n(4),s=n(7),f=function(){function e(e,t,n,o,r){this.resolver=e,this.container=t,this.dynamicFieldService=n,this.preloadService=o,this.fb=r}var t,n,f,d,u,p,m;return e.prototype.ngOnInit=function(){if(!this.group)throw new Error("group is not set");var e=this.dynamicFieldService.getField(this.field.type),t=this.resolver.resolveComponentFactory(e);this.component=this.container.createComponent(t),this.component.instance.field=this.field,this.component.instance.group=this.group,this.group.addControl(this.field.name,this.createControl(this.field)),this.model&&this.model[this.field.name]&&this.group.get(this.field.name).patchValue(this.model[this.field.name])},e.prototype.createControl=function(e){var t=e.disabled,n=e.required,o=e.minLength,r=e.maxLength,i=e.email,a=e.min,l=e.max,s=e.pattern,f=e.value,d=[];return void 0!==n&&n&&d.push(c.Validators.required),void 0!==o&&d.push(c.Validators.minLength(o)),void 0!==r&&d.push(c.Validators.maxLength(r)),void 0!==i&&d.push(c.Validators.email),void 0!==a&&d.push(c.Validators.min(a)),void 0!==l&&d.push(c.Validators.max(l)),void 0!==s&&d.push(c.Validators.pattern(s)),this.fb.control({disabled:t,value:f},d)},e.prototype.ngOnDestroy=function(){this.component&&this.component.destroy()},o([i.Input(),r("design:type","function"==typeof(t=void 0!==a.IFieldConfig&&a.IFieldConfig)?t:Object)],e.prototype,"field",void 0),o([i.Input(),r("design:type","function"==typeof(n=void 0!==c.FormGroup&&c.FormGroup)?n:Object)],e.prototype,"group",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"model",void 0),e=o([i.Directive({selector:"[dynamicField]"}),r("design:paramtypes",["function"==typeof(f=void 0!==i.ComponentFactoryResolver&&i.ComponentFactoryResolver)?f:Object,"function"==typeof(d=void 0!==i.ViewContainerRef&&i.ViewContainerRef)?d:Object,"function"==typeof(u=void 0!==l.DynamicFieldService&&l.DynamicFieldService)?u:Object,"function"==typeof(p=void 0!==s.PreloadService&&s.PreloadService)?p:Object,"function"==typeof(m=void 0!==c.FormBuilder&&c.FormBuilder)?m:Object])],e)}();t.DynamicFieldDirective=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-input",template:n(15)})],e)}();t.FormInputComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
\n'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-select",template:n(17)})],e)}();t.FormSelectComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){this.quillToolbar={toolbar:["bold","italic","underline","strike",{header:1},{header:2},{list:"ordered"},{list:"bullet"},"blockquote","code-block","link"]}}return e=o([r.Component({selector:"form-text-editor",template:n(19),styles:[n(20).toString()]})],e)}();t.FormTextEditorComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
'},function(e,t,n){var o=n(21);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(3)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(2)(!1)).push([e.i,"form-text-editor .editor-container {\n margin-bottom: 40px; }\n\nform-text-editor .ql-container.ql-disabled {\n background-color: #e9ecef; }\n",""])},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,o=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var r,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(r=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")})}},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-checkbox",template:n(24)})],e)}();t.FormCheckboxComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
\n'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-radio",template:n(26)})],e)}();t.FormRadioComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-textarea",template:n(28)})],e)}();t.FormTextareaComponent=i},function(e,t){e.exports='
\n \n
\n \n
\n
'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-hidden",template:n(30)})],e)}();t.FormInputHiddenComponent=i},function(e,t){e.exports='\n \n\n'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(){function e(){}return e=o([r.Component({selector:"form-label",template:n(32)})],e)}();t.FormLabelComponent=i},function(e,t){e.exports='
\n \n
\n {{group.value[this.field.name]}}\n
\n
'},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(1),a=function(){function e(){}return Object.defineProperty(e.prototype,"changes",{get:function(){return this.form.valueChanges},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.form.valid},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.form.value},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.form=new c.FormGroup({});var t=[];this.formConfig.form.forEach(function(e){e.fields&&(t=t.concat(e.fields)),e.panels&&e.panels.forEach(function(e){e.fields&&(t=t.concat(e.fields))})}),t.forEach(function(t){if(t.lookup&&e.lookups){var n="string"==typeof t.lookup?{name:t.lookup,extract:null}:t.lookup;t.options=n.extract?e.lookups[n.name].map(function(e){return e[n.extract]}):e.lookups[n.name]}else;})},o([i.Input(),r("design:type",Object)],e.prototype,"formConfig",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"model",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"lookups",void 0),e=o([i.Component({exportAs:"dynamicForm",selector:"dynamic-form",template:n(34),styles:[n(35).toString()]})],e)}();t.DynamicFormComponent=a},function(e,t){e.exports='
\n
\n \n
\n
\n
\n\n \n \n \n\n \n \n \n
\n
\n
'},function(e,t,n){var o=n(36);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(3)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(2)(!1)).push([e.i,".required-icon {\n color: red; }\n",""])},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=function(){function e(){}return o([i.Input(),r("design:type",Object)],e.prototype,"panelConfig",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"group",void 0),o([i.Input(),r("design:type",Object)],e.prototype,"model",void 0),e=o([i.Component({selector:"dynamic-panel",template:n(38),styles:[n(39).toString()]})],e)}();t.DynamicPanelComponent=c},function(e,t){e.exports='
\n
\n {{panelConfig.label}}\n
\n
\n
\n
\n
'},function(e,t,n){var o=n(40);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(3)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(2)(!1)).push([e.i,"dynamic-panel .panel {\n margin-bottom: 20px;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #ddd;\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); }\n dynamic-panel .panel .panel-heading {\n color: #333;\n background-color: #f5f5f5;\n padding: 10px 15px;\n border-bottom: 1px solid #ddd;\n border-top-left-radius: 3px;\n border-top-right-radius: 3px; }\n dynamic-panel .panel .panel-body {\n padding: 15px; }\n",""])},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=n(42),c=n(46),a=n(5),l=n(6),s=function(){function e(){}return e=o([r.NgModule({imports:[l.CommonModule],declarations:[i.FormNavComponent,c.NavDirective],exports:[i.FormNavComponent,c.NavDirective],providers:[a.FormNavService],schemas:[r.NO_ERRORS_SCHEMA]})],e)}();t.FormNavModule=s},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(5),a=n(1),l=function(){function e(e){this.ns=e,this.ref={groups:[]},this.subscriptions=[],e.addWatcher(this.ref)}var t,l;return e.prototype.ngAfterContentInit=function(){for(var e=this,t=(Object.keys(this.form.controls),function(t){var n=[];t.fields&&(n=n.concat(t.fields)),t.panels&&t.panels.forEach(function(e){e.fields&&(n=n.concat(e.fields))}),t.controls=n.map(function(t){return e.form.get(t.name)}),t.controls.forEach(function(n){e.subscriptions.push(n.statusChanges.subscribe(function(){t.valid=t.controls.every(function(e){return e.valid})}))})}),n=0,o=this.ref.groups;nthis.ref.groups.length-2},e.prototype.ngOnDestroy=function(){this.subscriptions.forEach(function(e){return e.unsubscribe()}),this.ns.reset()},o([i.Input(),r("design:type","function"==typeof(t=void 0!==a.FormGroup&&a.FormGroup)?t:Object)],e.prototype,"form",void 0),e=o([i.Component({selector:"form-nav",template:n(43),styles:[n(44).toString()]}),r("design:paramtypes",["function"==typeof(l=void 0!==c.FormNavService&&c.FormNavService)?l:Object])],e)}();t.FormNavComponent=l},function(e,t){e.exports='\n
\n
\n
\n \n \n
\n
\n
'},function(e,t,n){var o=n(45);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(3)(o,r);o.locals&&(e.exports=o.locals)},function(e,t,n){(e.exports=n(2)(!1)).push([e.i,"",""])},function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,c=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(c=(i<3?r(c):i>3?r(t,n,c):r(t,n))||c);return i>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=n(5),a=function(){function e(e){this.navService=e}var t;return e.prototype.ngOnInit=function(){this.panel.static||this.navService.add(this.panel)},o([i.Input("navTab"),r("design:type",Object)],e.prototype,"panel",void 0),e=o([i.Directive({selector:"[navTab]"}),r("design:paramtypes",["function"==typeof(t=void 0!==c.FormNavService&&c.FormNavService)?t:Object])],e)}();t.NavDirective=a},function(e,t){e.exports=require("ngx-chips")},function(e,t){e.exports=require("@angular/platform-browser/animations")}])}); \ No newline at end of file diff --git a/src/app/containers/dynamic-form/dynamic-form.component.ts b/src/app/containers/dynamic-form/dynamic-form.component.ts index b075c35..12a9186 100644 --- a/src/app/containers/dynamic-form/dynamic-form.component.ts +++ b/src/app/containers/dynamic-form/dynamic-form.component.ts @@ -24,7 +24,7 @@ export class DynamicFormComponent implements OnInit { public ngOnInit(): void { this.form = new FormGroup({}); - this.form.disable(); + // this.form.disable(); let fields: IFieldConfig[] = []; this.formConfig.form.forEach(gr => {