@eqproject/eqp-dynamic-module 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,5 +13,5 @@
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};function __extends(e,t){function o(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function __rest(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(o[i[n]]=e[i[n]])}return o}function __decorate(e,t,o,i){var n,r=arguments.length,l=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(l=(r<3?n(l):r>3?n(t,o,l):n(t,o))||l);return r>3&&l&&Object.defineProperty(t,o,l),l}function __param(e,t){return function(o,i){t(o,i,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,o,i){return new(o||(o=Promise))((function(n,r){function l(e){try{d(i.next(e))}catch(e){r(e)}}function a(e){try{d(i.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(l,a)}d((i=i.apply(e,t||[])).next())}))}function __generator(e,t){var o,i,n,r,l={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return l.label++,{value:r[1],done:!1};case 5:l.label++,i=r[1],r=[0];continue;case 7:r=l.ops.pop(),l.trys.pop();continue;default:if(!(n=(n=l.trys).length>0&&n[n.length-1])&&(6===r[0]||2===r[0])){l=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){l.label=r[1];break}if(6===r[0]&&l.label<n[1]){l.label=n[1],n=r;break}if(n&&l.label<n[2]){l.label=n[2],l.ops.push(r);break}n[2]&&l.ops.pop(),l.trys.pop();continue}r=t.call(e,l)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function __createBinding(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}function __exportStar(e,t){for(var o in e)"default"===o||t.hasOwnProperty(o)||(t[o]=e[o])}function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],i=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var i,n,r=o.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)l.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}return l}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}function __spreadArrays(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;var i=Array(e),n=0;for(t=0;t<o;t++)for(var r=arguments[t],l=0,a=r.length;l<a;l++,n++)i[n]=r[l];return i}function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}function __asyncGenerator(e,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,n=o.apply(e,t||[]),r=[];return i={},l("next"),l("throw"),l("return"),i[Symbol.asyncIterator]=function(){return this},i;function l(e){n[e]&&(i[e]=function(t){return new Promise((function(o,i){r.push([e,t,o,i])>1||a(e,t)}))})}function a(e,t){try{(o=n[e](t)).value instanceof __await?Promise.resolve(o.value.v).then(d,s):m(r[0][2],o)}catch(e){m(r[0][3],e)}var o}function d(e){a("next",e)}function s(e){a("throw",e)}function m(e,t){e(t),r.shift(),r.length&&a(r[0][0],r[0][1])}}function __asyncDelegator(e){var t,o;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,n){t[i]=e[i]?function(t){return(o=!o)?{value:__await(e[i](t)),done:"return"===i}:n?n(t):t}:n}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,o=e[Symbol.asyncIterator];return o?o.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=e[o]&&function(t){return new Promise((function(i,n){(function(e,t,o,i){Promise.resolve(i).then((function(t){e({value:t,done:o})}),t)})(i,n,(t=e[o](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,o){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,o),o}var Context=function(){this.User=new ContextUser},ContextUser=function(){},BaseObj=function(){},Form=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseObj),FormFieldGroup=function(){},ActionOnRecord=function(){},FormTypeEnum,FormScalarTypeEnum;FormTypeEnum=exports.FormTypeEnum||(exports.FormTypeEnum={}),FormTypeEnum[FormTypeEnum.SCALAR=1]="SCALAR",FormTypeEnum[FormTypeEnum.LIST=2]="LIST",FormScalarTypeEnum=exports.FormScalarTypeEnum||(exports.FormScalarTypeEnum={}),FormScalarTypeEnum[FormScalarTypeEnum.Semplice=1]="Semplice",FormScalarTypeEnum[FormScalarTypeEnum["A step"]=2]="A step",FormScalarTypeEnum[FormScalarTypeEnum["In tab"]=3]="In tab",FormScalarTypeEnum[FormScalarTypeEnum["In accordion"]=4]="In accordion";var BaseField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseObj),FieldTypeEnum,ColSpanSizesEnum;FieldTypeEnum=exports.FieldTypeEnum||(exports.FieldTypeEnum={}),FieldTypeEnum[FieldTypeEnum["Campo di testo"]=1]="Campo di testo",FieldTypeEnum[FieldTypeEnum["Area di testo"]=2]="Area di testo",FieldTypeEnum[FieldTypeEnum.Booleano=3]="Booleano",FieldTypeEnum[FieldTypeEnum["Data e/o ora"]=4]="Data e/o ora",FieldTypeEnum[FieldTypeEnum["Campo numerico"]=5]="Campo numerico",FieldTypeEnum[FieldTypeEnum.Allegato=6]="Allegato",FieldTypeEnum[FieldTypeEnum.Immagine=7]="Immagine",FieldTypeEnum[FieldTypeEnum["Elenco generico"]=8]="Elenco generico",FieldTypeEnum[FieldTypeEnum.Lookup=9]="Lookup",FieldTypeEnum[FieldTypeEnum["Form di dettaglio"]=10]="Form di dettaglio",ColSpanSizesEnum=exports.ColSpanSizesEnum||(exports.ColSpanSizesEnum={}),ColSpanSizesEnum[ColSpanSizesEnum["col-sm-3"]=1]="col-sm-3",ColSpanSizesEnum[ColSpanSizesEnum["col-sm-4"]=2]="col-sm-4",ColSpanSizesEnum[ColSpanSizesEnum["col-sm-6"]=3]="col-sm-6",ColSpanSizesEnum[ColSpanSizesEnum["col-sm-12"]=4]="col-sm-12",ColSpanSizesEnum[ColSpanSizesEnum["col-md-3"]=5]="col-md-3",ColSpanSizesEnum[ColSpanSizesEnum["col-md-4"]=6]="col-md-4",ColSpanSizesEnum[ColSpanSizesEnum["col-md-6"]=7]="col-md-6",ColSpanSizesEnum[ColSpanSizesEnum["col-md-12"]=8]="col-md-12",ColSpanSizesEnum[ColSpanSizesEnum["col-lg-3"]=9]="col-lg-3",ColSpanSizesEnum[ColSpanSizesEnum["col-lg-4"]=10]="col-lg-4",ColSpanSizesEnum[ColSpanSizesEnum["col-lg-6"]=11]="col-lg-6",ColSpanSizesEnum[ColSpanSizesEnum["col-lg-12"]=12]="col-lg-12";var ArrayValidators=function(){function e(){}return e.minLenght=function(e){return function(t){return t&&t.value&&Array.isArray(t.value)&&t.value.length>=e?null:{hasMinLenght:!1}}},e.maxLenght=function(e){return function(t){return t&&t.value&&Array.isArray(t.value)&&t.value.length<=e?null:{hasMinLenght:!1}}},e}(),UtilityHelperService=function(){function UtilityHelperService(e){this.formBuilder=e}var UtilityHelperService_1;return UtilityHelperService_1=UtilityHelperService,UtilityHelperService.EvaluateFieldFormula=function(formula,rec,ctx){var evaluatedValue=eval(formula.replace('"','"'));return evaluatedValue||null},UtilityHelperService.SetContext=function(e){this.context=e},UtilityHelperService.GetAutocompleteOptions=function(e,t){var o=[],i=e.map((function(e){return e.Label.split(" ").join("_")}));if(!t||!t.endsWith(".")&&new RegExp("[^0-9a-zA-Z_]").test(t.substring(t.length-1,t.length)))o=[{label:"rec",value:(t||"")+"rec"},{label:"ctx",value:(t||"")+"ctx"}];else if(t.endsWith(".")){var n=t.split(" ")[t.split(" ").length-1].split(".");o="rec"===n[n.length-2]?i.map((function(e){return{label:e,value:t+e}})):"ctx"===n[n.length-2]?Object.keys(UtilityHelperService_1.context).map((function(e){return{label:e,value:t+e}})):n.length>2&&"ctx"===n[n.length-3]&&"User"===n[n.length-2]?Object.keys(UtilityHelperService_1.context.User).map((function(e){return{label:e,value:t+e}})):[]}else{var r=[],l=t.split(" "),a=l[l.length-1];if(!new RegExp("[^0-9a-zA-Z_.]").test(a)){var d=a.split("."),s=d[d.length-1],m=[];1==d.length?m=["rec","ctx"]:d.length>1&&"ctx"===d[d.length-2]?m=Object.keys(UtilityHelperService_1.context):d.length>2&&"ctx"===d[d.length-3]&&"User"===d[d.length-2]?m=Object.keys(UtilityHelperService_1.context.User):d.length>1&&"rec"===d[d.length-2]&&(m=i),m.forEach((function(e){e.startsWith(s)&&r.push({label:e,value:t+e.substring(s.length,e.length)})}))}o=r}return o},UtilityHelperService.prototype.getFieldSyleClass=function(e){if(e.ColSpanSizes&&e.ColSpanSizes.length>0)return e.ColSpanSizes.map((function(e){return exports.ColSpanSizesEnum[e].toString()})).join(" ");switch(e.FieldType){case exports.FieldTypeEnum["Campo di testo"]:return"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum["Area di testo"]:return"col-sm-12 col-md-12 col-lg-12";case exports.FieldTypeEnum.Booleano:return"col-sm-12 col-md-4 col-lg-4 d-flex align-items-center";case exports.FieldTypeEnum["Data e/o ora"]:case exports.FieldTypeEnum["Campo numerico"]:return"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum.Allegato:return e.IsMultiAttach||e.MetadataFields&&e.MetadataFields.length>0?"col-sm-12 col-md-12 col-lg-12":"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum.Immagine:return e.AttachDefinition.IsMultiAttach||e.AttachDefinition.MetadataFields&&e.AttachDefinition.MetadataFields.length>0?"col-sm-12 col-md-12 col-lg-12":"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum["Elenco generico"]:case exports.FieldTypeEnum.Lookup:return"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum["Form di dettaglio"]:return"col-sm-12 col-md-12 col-lg-12"}},UtilityHelperService.prototype.CreateFormFormGroup=function(e,t,o,i){var n=this;void 0===o&&(o=!1),void 0===i&&(i=!0);var r=this.formBuilder.group([]);return e.forEach((function(e){r.addControl(e.Name,n.createFieldFormControl(e,t)),i&&(e.FormFormGroup=r)})),o&&r.disable(),r},UtilityHelperService.prototype.createFieldFormControl=function(e,t){var o=[];switch(e.Required&&o.push(forms.Validators.required),e.FieldType){case exports.FieldTypeEnum["Campo di testo"]:case exports.FieldTypeEnum["Area di testo"]:e.MaxLenght&&o.push(forms.Validators.maxLength(e.MaxLenght)),e.MinLenght&&o.push(forms.Validators.minLength(e.MinLenght));break;case exports.FieldTypeEnum.Allegato:case exports.FieldTypeEnum.Immagine:e.Required&&o.push(ArrayValidators.minLenght(1));break;case exports.FieldTypeEnum["Elenco generico"]:e.IsMultiChoiche&&e.Required&&o.push(ArrayValidators.minLenght(1))}return new forms.FormControl(t[e.Name],o)},UtilityHelperService.context=new Context,UtilityHelperService.ctorParameters=function(){return[{type:forms.FormBuilder}]},UtilityHelperService.ɵprov=core.ɵɵdefineInjectable({factory:function(){return new UtilityHelperService(core.ɵɵinject(forms.FormBuilder))},token:UtilityHelperService,providedIn:"root"}),UtilityHelperService=UtilityHelperService_1=__decorate([core.Injectable({providedIn:"root"})],UtilityHelperService),UtilityHelperService}(),EqpDynamicModuleComponent=function(){function e(){this.context=new Context,this.form=new Form,this.showButtons=!0,this.viewMode=exports.FormTypeEnum.LIST,this.FormTypeEnum=exports.FormTypeEnum}return e.prototype.ngOnInit=function(){UtilityHelperService.SetContext(this.context)},e.prototype.onAddViewEditRecord=function(e){null!=e?(this.selectedRecord=JSON.parse(JSON.stringify(e.record)),this.onlyView=e.onlyView):(this.selectedRecord=null,this.onlyView=!1),this.viewMode=exports.FormTypeEnum.SCALAR},e.prototype.onSaveForm=function(e){null!=e&&(e.ID&&this.values.find((function(t){return t.ID==e.ID}))?this.values[this.values.findIndex((function(t){return t.ID==e.ID}))]=e:this.values.push(e)),this.viewMode=exports.FormTypeEnum.LIST,console.log(e)},__decorate([core.Input()],e.prototype,"context",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"values",void 0),__decorate([core.Input()],e.prototype,"showButtons",void 0),__decorate([core.Input()],e.prototype,"viewMode",void 0),e=__decorate([core.Component({selector:"eqp-dynamic-module",template:'<add-form-record *ngIf="viewMode == FormTypeEnum.SCALAR" [form]="form" [record]="selectedRecord"\r\n [showButtons]="showButtons" [onlyView]="onlyView" (saveRecordEvent)="onSaveForm($event)">\r\n</add-form-record>\r\n\r\n<list-form-record *ngIf="viewMode == FormTypeEnum.LIST" [form]="form" [values]="values"\r\n (onAddViewEditRecord)="onAddViewEditRecord($event)">\r\n</list-form-record>',styles:["::ng-deep mat-form-field{width:100%}"]})],e)}(),MaterialModule=function(){function e(){}return e=__decorate([core.NgModule({imports:[checkbox.MatCheckboxModule,button.MatButtonModule,input.MatInputModule,autocomplete.MatAutocompleteModule,datepicker.MatDatepickerModule,formField.MatFormFieldModule,radio.MatRadioModule,select.MatSelectModule,slider.MatSliderModule,slideToggle.MatSlideToggleModule,menu.MatMenuModule,sidenav.MatSidenavModule,toolbar.MatToolbarModule,list.MatListModule,gridList.MatGridListModule,card.MatCardModule,stepper.MatStepperModule,tabs.MatTabsModule,expansion.MatExpansionModule,buttonToggle.MatButtonToggleModule,chips.MatChipsModule,icon.MatIconModule,progressSpinner.MatProgressSpinnerModule,progressBar.MatProgressBarModule,dialog.MatDialogModule,tooltip.MatTooltipModule,snackBar.MatSnackBarModule,table.MatTableModule,sort.MatSortModule,paginator.MatPaginatorModule,datepicker.MatDatepickerModule,core$1.MatNativeDateModule],exports:[checkbox.MatCheckboxModule,button.MatButtonModule,input.MatInputModule,autocomplete.MatAutocompleteModule,datepicker.MatDatepickerModule,formField.MatFormFieldModule,radio.MatRadioModule,select.MatSelectModule,slider.MatSliderModule,slideToggle.MatSlideToggleModule,menu.MatMenuModule,sidenav.MatSidenavModule,toolbar.MatToolbarModule,list.MatListModule,gridList.MatGridListModule,card.MatCardModule,stepper.MatStepperModule,tabs.MatTabsModule,expansion.MatExpansionModule,buttonToggle.MatButtonToggleModule,chips.MatChipsModule,icon.MatIconModule,progressSpinner.MatProgressSpinnerModule,progressBar.MatProgressBarModule,dialog.MatDialogModule,tooltip.MatTooltipModule,snackBar.MatSnackBarModule,table.MatTableModule,sort.MatSortModule,paginator.MatPaginatorModule]})],e)}(),EqpDynamicModuleDialogService=function(){function e(){}return e.Error=function(e,t){void 0===t&&(t=null);var o=null!=t?t:"Errore";if(Array.isArray(e)){o=null!=t?t:"Errore";var i=e.join("<br>");Swal.fire({title:o,html:i,icon:"error"})}else Swal.fire(o,e,"error")},e.Confirm=function(e,t,o,i,n){void 0===o&&(o=!1),void 0===i&&(i=null),void 0===n&&(n=null);var r=null!=i?i:"Sei sicuro di voler procedere?";if(Array.isArray(e)){var l=e.join("<br>");Swal.fire({title:r,html:l,width:n||"32rem",icon:o?"warning":"question",showCancelButton:!0,allowOutsideClick:!1,allowEscapeKey:!1}).then((function(e){e.value&&t&&t()}))}else Swal.fire({title:r,text:e,width:n||"32rem",icon:o?"warning":"question",showCancelButton:!0,allowOutsideClick:!1,allowEscapeKey:!1}).then((function(e){e.value&&t&&t()}))},e.Info=function(e,t,o){void 0===t&&(t=null),void 0===o&&(o=null);var i=null!=t?t:"Informazione:";Swal.fire(i,e,"info")},e.Warning=function(e,t,o){void 0===t&&(t=null),void 0===o&&(o=null);var i=null!=t?t:"Attenzione!";if(Array.isArray(e)){var n=e.join("<br>");Swal.fire({title:i,html:n,icon:"warning"})}else Swal.fire(i,e,"warning")},e.ɵprov=core.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=__decorate([core.Injectable({providedIn:"root"})],e)}(),EqpDynamicModuleConfiguratorComponent=function(){function e(e,t){this.formBuilder=e,this.dialog=t,this.context=new Context,this.form=new Form,this.innerFormManagment=!1,this.formCompleted=!1,this.FormTypeEnum=exports.FormTypeEnum,this.FormScalarTypeEnum=exports.FormScalarTypeEnum,this.saveFormEvent=new core.EventEmitter}return e.prototype.ngOnInit=function(){this.context&&UtilityHelperService.SetContext(this.context),this.configureColumns(),this.createFormForm()},e.prototype.onChangeFormScalarType=function(){this.form.FormScalarType!=exports.FormScalarTypeEnum.Semplice?this.formFormGroup.contains("FormFieldsGroups")||(this.formFormGroup.removeControl("FormFieldsGroups"),this.formFormGroup.addControl("FormFieldsGroups",new forms.FormControl(this.form.FormFieldsGroups,[forms.Validators.required,ArrayValidators.minLenght(1)]))):(this.form.FormFieldsGroups=null,this.formFormGroup.contains("FormFieldsGroups")&&this.formFormGroup.removeControl("FormFieldsGroups")),this.formFormGroup.updateValueAndValidity(),this.configureColumns()},e.prototype.onFormFieldGroupNameKeyUp=function(e){var t=this;"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.form.FormFieldsGroups||(this.form.FormFieldsGroups=new Array),this.form.FormFieldsGroups.find((function(e){return e.Name==t.formFieldGroupName}))||this.form.FormFieldsGroups.push({Name:this.formFieldGroupName}),this.formFormGroup.controls.FormFieldsGroups.setValue(this.form.FormFieldsGroups),this.formFieldGroupName=null,this.setFormFieldGroupOrdinalPosition())},e.prototype.onDeleteFormFieldGroupName=function(e){this.form.FormFieldsGroups.splice(this.form.FormFieldsGroups.findIndex((function(t){return t.Name===e})),1),this.formFormGroup.controls.FormFieldsGroups.setValue(this.form.FormFieldsGroups),this.form.Fields.find((function(t){return t.FieldGroup==e}))&&this.form.Fields.filter((function(t){return t.FieldGroup==e})).forEach((function(e){return e.FieldGroup=null})),this.setFormFieldGroupOrdinalPosition()},e.prototype.openFieldDialog=function(e){void 0===e&&(e=null),e?(this.indexSelectedField=this.form.Fields.indexOf(e),this.selectedField=JSON.parse(JSON.stringify(e))):(this.selectedField=new BaseField,this.indexSelectedField=null),this.dialogFieldRef=this.dialog.open(this.dialogField,{disableClose:!0,hasBackdrop:!0,width:"75%"})},e.prototype.onSaveField=function(e){var t=this;if(e){if(this.form.Fields&&this.form.Fields.find((function(o,i){return o.Label===e.Label&&(null==t.indexSelectedField||t.indexSelectedField!==i)})))throw EqpDynamicModuleDialogService.Warning("Impossibile inserire due campi con la stessa label."),new Error("Impossibile inserire due campi con la stessa label.");null!=this.indexSelectedField&&this.indexSelectedField>=0?this.form.Fields[this.indexSelectedField]=e:(this.form.Fields||(this.form.Fields=new Array),this.form.Fields.push(e))}this.closeFieldDialog(),this.setFieldOrdinalPosition(),this.reloadFieldsTable()},e.prototype.isFieldStepCompleted=function(){return!!this.form.Fields&&((this.form.FormScalarType==exports.FormScalarTypeEnum.Semplice||!this.form.Fields.find((function(e){return!e.FieldGroup})))&&this.form.Fields.length>0)},e.prototype.openInnerFormDialog=function(e){void 0===e&&(e=null),e?(this.indexSelectedInnerForm=this.form.InnerForms.indexOf(e),this.selectedInnerForm=JSON.parse(JSON.stringify(e)),this.selectedInnerForm.OldName=e.Name,this.indexSelectedField=this.form.Fields.findIndex((function(t){return t.Label===e.Name}))):(this.selectedInnerForm=new Form,this.indexSelectedInnerForm=null,this.indexSelectedField=null),this.dialogInnerFormRef=this.dialog.open(this.dialogInnerForm,{disableClose:!0,hasBackdrop:!0,width:"85%"})},e.prototype.onSaveOrExitInnerForm=function(e){var t=this;if(null!=e){if(this.form.Name===e.Name||this.form.InnerForms&&this.form.InnerForms.find((function(o,i){return o.Name===e.Name&&(null==t.indexSelectedInnerForm||t.indexSelectedInnerForm!==i)}))||this.form.Fields&&null==this.indexSelectedInnerForm&&this.form.Fields.find((function(o,i){return o.Label===e.Name&&(null==t.indexSelectedField||t.indexSelectedField!==i)})))throw EqpDynamicModuleDialogService.Warning("Impossibile inserire due form di dettaglio con lo stesso nome."),new Error("Impossibile inserire due form di dettaglio con lo stesso nome.");var o=new BaseField;o.Name=e.Name.split(" ").join("_"),o.Label=e.Name,o.FieldType=exports.FieldTypeEnum["Form di dettaglio"],o.FieldGroup=null!=this.indexSelectedField?this.form.Fields[this.indexSelectedField].FieldGroup:null,null!=this.indexSelectedInnerForm&&this.indexSelectedInnerForm>=0?(this.form.InnerForms[this.indexSelectedInnerForm]=e,this.form.Fields[this.indexSelectedField]=o):(this.form.InnerForms||(this.form.InnerForms=new Array),this.form.InnerForms.push(e),this.form.Fields.push(o)),this.reloadFieldsTable()}this.dialogInnerFormRef.close()},e.prototype.openActionOnRecordDialog=function(e){void 0===e&&(e=null),e?(this.indexSelectedAction=this.form.ActionsOnRecord.indexOf(e),this.selectedAction=JSON.parse(JSON.stringify(e))):(this.selectedAction=new ActionOnRecord,this.indexSelectedAction=null),this.createActionOnRecordForm(),this.dialogActionOnRecordRef=this.dialog.open(this.dialogActionOnRecord,{disableClose:!0,hasBackdrop:!0,width:"75%"})},e.prototype.setActionAutocompleteOptions=function(e){e&&e.code.includes("Arrow")||(this.actionAutocompleteOptions=UtilityHelperService.GetAutocompleteOptions(this.form.Fields,this.selectedAction.Action))},e.prototype.saveActionOnRecord=function(){var e=this;if(this.form.ActionsOnRecord&&this.form.ActionsOnRecord.find((function(t,o){return t.Name===e.selectedAction.Name&&(null==e.indexSelectedAction||e.indexSelectedAction!==o)})))throw EqpDynamicModuleDialogService.Warning("Impossibile inserire due action con lo stesso nome."),new Error("Impossibile inserire due action con lo stesso nome.");null!=this.indexSelectedAction&&this.indexSelectedAction>=0?this.form.ActionsOnRecord[this.indexSelectedAction]=this.selectedAction:(this.form.ActionsOnRecord||(this.form.ActionsOnRecord=new Array),this.form.ActionsOnRecord.push(this.selectedAction)),this.closeDialogActionOnRecord(),this.setActionOrdinalPosition(),this.reloadActionsOnRecordTable()},e.prototype.closeDialogActionOnRecord=function(){this.dialogActionOnRecordRef.close()},e.prototype.setFormStatus=function(e){e?(this.formCompleted=!0,this.previewForm=JSON.parse(JSON.stringify(this.form)),this.previewForm.Fields.forEach((function(e){e.Name=e.Label.split(" ").join("_")})),this.previewForm.InnerForms&&this.previewForm.InnerForms.length>0&&this.previewForm.InnerForms.forEach((function(e){e.Fields.forEach((function(e){e.Name=e.Label.split(" ").join("_")}))}))):(this.formCompleted=!1,this.previewForm=null)},e.prototype.saveForm=function(){this.saveFormEvent.emit(this.form)},e.prototype.configureColumns=function(){var e=this;this.fieldsColumns=[{key:"action",display:"",type:eqpTable.TypeColumn.MenuAction,buttonMenuIcon:"more_vert",styles:{flex:"0 0 6%"},actions:[{name:"Modifica",icon:"edit",fn:function(t,o,i){return e.editField(t)}},{name:"Elimina",icon:"delete",fn:function(t,o,i){return e.deleteElement(t,"Fields")}},{name:"Sposta su",icon:"arrow_upward",fn:function(t,o,i){return e.moveElement(t,!0,"Fields")},disabled:function(t){return 0===e.form.Fields.indexOf(t)}},{name:"Sposta giù",icon:"arrow_downward",fn:function(t,o,i){return e.moveElement(t,!1,"Fields")},disabled:function(t){return e.form.Fields.indexOf(t)>=e.form.Fields.length-1}}]},{key:"FieldType",display:"Tipologia",type:eqpTable.TypeColumn.Enum,enumModel:exports.FieldTypeEnum},{key:"Label",display:"Label"},{key:"Description",display:"Descrizione"},{key:"Required",display:"Obbligatorio",value:function(e){return!!e.Required},type:eqpTable.TypeColumn.Boolean,booleanValues:{true:'<i class="fa fa-check success-color"></i>',false:'<i class="fa fa-close error-color"></i>'},styles:{flex:"0 0 7%",cellAlignment:eqpTable.CellAlignmentEnum.CENTER}}],this.form.FormScalarType&&this.form.FormScalarType!=exports.FormScalarTypeEnum.Semplice&&this.fieldsColumns.splice(this.fieldsColumns.findIndex((function(e){return"Description"==e.key})),0,{key:"FieldGroup",display:"Sezione",type:eqpTable.TypeColumn.ExternalTemplate,externalTemplate:this.fieldSectionColumnTemplate}),this.actionsOnRecordColumns=[{key:"action",display:"",type:eqpTable.TypeColumn.MenuAction,buttonMenuIcon:"more_vert",styles:{flex:"0 0 6%"},actions:[{name:"Modifica",icon:"edit",fn:function(t,o,i){return e.openActionOnRecordDialog(t)}},{name:"Elimina",icon:"delete",fn:function(t,o,i){return e.deleteElement(t,"ActionsOnRecord")}},{name:"Sposta su",icon:"arrow_upward",fn:function(t,o,i){return e.moveElement(t,!0,"ActionsOnRecord")},disabled:function(t){return 0===e.form.ActionsOnRecord.indexOf(t)}},{name:"Sposta giù",icon:"arrow_downward",fn:function(t,o,i){return e.moveElement(t,!1,"ActionsOnRecord")},disabled:function(t){return e.form.ActionsOnRecord.indexOf(t)>=e.form.ActionsOnRecord.length-1}}]},{key:"Icon",display:"Icona",styles:{flex:" 0 0 15%"}},{key:"Name",display:"Nome",styles:{flex:" 0 0 20%"}},{key:"Action",display:"Azione"}]},e.prototype.createFormForm=function(){this.formFormGroup=this.formBuilder.group({Name:[this.form.Name,forms.Validators.required],FormScalarType:[this.form.FormScalarType,forms.Validators.required]}),this.onChangeFormScalarType()},e.prototype.createActionOnRecordForm=function(){this.actionOnRecordFormGroup=this.formBuilder.group({Name:[this.selectedAction.Name,forms.Validators.required],Icon:[this.selectedAction.Icon,forms.Validators.required],Action:[this.selectedAction.Action,forms.Validators.required]})},e.prototype.closeFieldDialog=function(){this.dialogFieldRef.close()},e.prototype.editField=function(e){e.FieldType!=exports.FieldTypeEnum["Form di dettaglio"]?this.openFieldDialog(e):this.openInnerFormDialog(this.form.InnerForms.find((function(t){return t.Name==e.Label})))},e.prototype.deleteElement=function(e,t){var o=this;EqpDynamicModuleDialogService.Confirm("Eliminare l'elemento selezionato?",(function(){o.form[t].splice(o.form[t].indexOf(e),1),"Fields"===t?(o.setFieldOrdinalPosition(),o.reloadFieldsTable()):"ActionsOnRecord"===t&&(o.setActionOrdinalPosition(),o.reloadActionsOnRecordTable())}),!1,"Richiesta conferma")},e.prototype.moveElement=function(e,t,o){var i=this.form[o].indexOf(e),n=i+(t?-1:1);this.form[o].splice(i,1),this.form[o].splice(n,0,e),"Fields"===o?(this.setFieldOrdinalPosition(),this.reloadFieldsTable()):"ActionsOnRecord"===o&&(this.setActionOrdinalPosition(),this.reloadActionsOnRecordTable())},e.prototype.setFormFieldGroupOrdinalPosition=function(){this.form.FormFieldsGroups.forEach((function(e,t){return e.OrdinalPosition=t}))},e.prototype.setFieldOrdinalPosition=function(){var e=this;this.form.Fields&&this.form.Fields.forEach((function(t){t.OrdinalPosition=e.form.Fields.indexOf(t)}))},e.prototype.reloadFieldsTable=function(){this.fieldsTable&&this.fieldsTable.reloadDatatable()},e.prototype.setActionOrdinalPosition=function(){var e=this;this.form.ActionsOnRecord&&this.form.ActionsOnRecord.forEach((function(t){t.OrdinalPosition=e.form.ActionsOnRecord.indexOf(t)}))},e.prototype.reloadActionsOnRecordTable=function(){this.actionsOnRecordTable&&this.actionsOnRecordTable.reloadDatatable()},e.ctorParameters=function(){return[{type:forms.FormBuilder},{type:dialog.MatDialog}]},__decorate([core.Input()],e.prototype,"context",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"innerFormManagment",void 0),__decorate([core.ViewChild("fieldsTable",{static:!1})],e.prototype,"fieldsTable",void 0),__decorate([core.ViewChild("dialogField",{static:!0})],e.prototype,"dialogField",void 0),__decorate([core.ViewChild("fieldSectionColumnTemplate",{static:!0})],e.prototype,"fieldSectionColumnTemplate",void 0),__decorate([core.ViewChild("dialogInnerForm",{static:!0})],e.prototype,"dialogInnerForm",void 0),__decorate([core.ViewChild("actionsOnRecordTable",{static:!1})],e.prototype,"actionsOnRecordTable",void 0),__decorate([core.ViewChild("dialogActionOnRecord",{static:!0})],e.prototype,"dialogActionOnRecord",void 0),__decorate([core.Output()],e.prototype,"saveFormEvent",void 0),e=__decorate([core.Component({selector:"eqp-dynamic-module-configurator",template:'<mat-horizontal-stepper linear #stepper>\r\n \x3c!-- DATI GENERALI DELLA FORM --\x3e\r\n <mat-step [stepControl]="formFormGroup">\r\n <form [formGroup]="formFormGroup" (keydown.enter)="false">\r\n <ng-template matStepLabel>\r\n <div class="stepper-header-overlay" (click)="setFormStatus(false)"></div>\r\n Dati generali della form\r\n </ng-template>\r\n\r\n <div class="row">\r\n <div class="col-md-4">\r\n <mat-form-field>\r\n <mat-label>Nome</mat-label>\r\n <input matInput formControlName="Name" [(ngModel)]="form.Name" required>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class="col-md-4">\r\n <eqp-select [enumData]="FormScalarTypeEnum" [(ngModelInput)]="form.FormScalarType"\r\n [isRequired]="true" [showCancelButton]="false" placeholder="Tipo di visualizzazione"\r\n [formGroupInput]="formFormGroup" [formControlNameInput]="\'FormScalarType\'"\r\n (ngModelInputChange)="onChangeFormScalarType()">\r\n </eqp-select>\r\n </div>\r\n </div>\r\n <div class="row" *ngIf="form.FormScalarType && form.FormScalarType != FormScalarTypeEnum.Semplice">\r\n <div class="col-md-4 d-flex align-items-center">\r\n <mat-form-field>\r\n <mat-label> Nome sezione (invio per confermare) </mat-label>\r\n <input matInput [(ngModel)]="formFieldGroupName" [ngModelOptions]="{standalone: true}"\r\n (keyup)="onFormFieldGroupNameKeyUp($event)">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-md-4 d-flex align-items-center">\r\n <span class="mr-3">Sezioni inserite:</span>\r\n <ul class="section-list">\r\n <li *ngFor="let groupName of form.FormFieldsGroups, let i=index">\r\n <mat-icon class="mr-1" (click)="onDeleteFormFieldGroupName(groupName.Name)">close\r\n </mat-icon>\r\n <span> {{i+1}}) {{groupName.Name}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <div class="mt-2 d-flex justify-content-end">\r\n <button mat-raised-button color="primary" matStepperNext\r\n [disabled]="formFormGroup.invalid">Successivo</button>\r\n </div>\r\n </form>\r\n </mat-step>\r\n\r\n \x3c!-- AGGIUNTA DEI CAMPI DELLA FORM --\x3e\r\n <mat-step [completed]="isFieldStepCompleted()">\r\n <ng-template matStepLabel>\r\n <div class="stepper-header-overlay" (click)="setFormStatus(false)"></div>\r\n Campi da inserire\r\n </ng-template>\r\n\r\n <div class="row justify-content-end">\r\n <button class="btn btn-primary" mat-raised-button color="primary" type="button" (click)="openFieldDialog()">\r\n <mat-icon>add</mat-icon>\r\n <span style="margin-left: 10px;">Aggiungi campo</span>\r\n </button>\r\n\r\n <button class="btn btn-primary ml-2" mat-raised-button color="primary" type="button"\r\n (click)="openInnerFormDialog()" *ngIf="!innerFormManagment">\r\n <mat-icon>add</mat-icon>\r\n <span style="margin-left: 10px;">Aggiungi form di dettaglio</span>\r\n </button>\r\n </div>\r\n\r\n <eqp-table #fieldsTable [createMatCard]="false" [columns]="fieldsColumns" [data]="form.Fields"\r\n [emptyTableMessage]="\'Nessun campo inserito\'" [searchText]="\'Cerca\'">\r\n </eqp-table>\r\n\r\n <div class="mt-2 d-flex justify-content-end">\r\n <button class="mr-2" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color="primary" matStepperNext [disabled]="!isFieldStepCompleted()"\r\n (click)="setFormStatus(false)">Successivo</button>\r\n </div>\r\n </mat-step>\r\n\r\n \x3c!-- AGGIUNTA DELLE OPERAZIONI SUI RECORD --\x3e\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class="stepper-header-overlay" (click)="setFormStatus(false)"></div>\r\n Azioni aggiuntive sui record\r\n </ng-template>\r\n\r\n <div class="row justify-content-end">\r\n <button class="btn btn-primary" mat-raised-button color="primary" type="button"\r\n (click)="openActionOnRecordDialog()">\r\n <mat-icon>add</mat-icon>\r\n <span style="margin-left: 10px;">Aggiungi azione</span>\r\n </button>\r\n </div>\r\n <eqp-table #actionsOnRecordTable [createMatCard]="false" [columns]="actionsOnRecordColumns"\r\n [data]="form.ActionsOnRecord" [emptyTableMessage]="\'Nessuna action inserita\'" [searchText]="\'Cerca\'">\r\n </eqp-table>\r\n\r\n <div class="mt-2 d-flex justify-content-end">\r\n <button class="mr-2" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color="primary" matStepperNext (click)="setFormStatus(true)">\r\n Successivo\r\n </button>\r\n </div>\r\n </mat-step>\r\n\r\n \x3c!-- VISUALIZZAZIONE FORM CREATA --\x3e\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class="stepper-header-overlay"\r\n (click)="setFormStatus(formFormGroup.valid && form.Fields && form.Fields.length > 0)"></div>\r\n Riepilogo\r\n </ng-template>\r\n\r\n <eqp-dynamic-module [form]="previewForm" *ngIf="previewForm && formCompleted" [showButtons]="false"\r\n [viewMode]="FormTypeEnum.SCALAR"></eqp-dynamic-module>\r\n\r\n <div class="mt-2 d-flex justify-content-end">\r\n <button class="mr-2" mat-raised-button matStepperPrevious (click)="setFormStatus(false)">Precedente</button>\r\n <button mat-raised-button color="primary" (click)="saveForm()">Salva form</button>\r\n </div>\r\n </mat-step>\r\n</mat-horizontal-stepper>\r\n\r\n<div class="row" *ngIf="innerFormManagment">\r\n <div class="col-md-12 text-right">\r\n <button mat-raised-button (click)="saveFormEvent.emit(null)">Esci</button>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- DIALOG AGGIUNTA/MODIFICA CAMPO --\x3e\r\n<ng-template #dialogField>\r\n <eqp-dynamic-module-add-form-field [field]="selectedField" [indexField]="indexSelectedField"\r\n (saveFieldEvent)="onSaveField($event)" [availableFields]="form.Fields"\r\n [formFieldsGroups]="form.FormScalarType != FormScalarTypeEnum.Semplice ? form.FormFieldsGroups : null">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n\x3c!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS --\x3e\r\n<ng-template #fieldSectionColumnTemplate let-row="row">\r\n <eqp-select [arrayData]="form.FormFieldsGroups" [(ngModelInput)]="row.FieldGroup" [arrayKeyProperty]="\'Name\'"\r\n [arrayValueProperty]="\'Name\'" placeholder="Sezione" [isRequired]="true" [includeFullObject]="false">\r\n </eqp-select>\r\n</ng-template>\r\n\r\n\x3c!-- DIALOG PER AGGIUNGERE/MODIFICARE UNA ACTION SUI RECORD DELLA FORM --\x3e\r\n<ng-template #dialogActionOnRecord>\r\n <div class="container-fluid" style="max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;">\r\n <form [formGroup]="actionOnRecordFormGroup">\r\n <div class="row">\r\n <div class="header-title-standard">{{indexSelectedAction != null && indexSelectedAction >= 0 ?\r\n "Modifica"\r\n : "Aggiungi"}} azione sul record</div>\r\n </div>\r\n <div class="row">\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <mat-form-field>\r\n <mat-label> Nome </mat-label>\r\n <input formControlName="Name" required matInput [(ngModel)]="selectedAction.Name">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <mat-form-field>\r\n <mat-label> Icona </mat-label>\r\n <input formControlName="Icon" required matInput [(ngModel)]="selectedAction.Icon">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class="row">\r\n <div class="col-sm-12 col-md-12 mt-2">\r\n <mat-form-field>\r\n <textarea matInput [placeholder]="\'Azione (Javascript)\'" [rows]="3" formControlName="Action"\r\n required [(ngModel)]="selectedAction.Action" [matAutocomplete]="actionAutocomplete"\r\n (keyup)="setActionAutocompleteOptions($event)"\r\n (focus)="setActionAutocompleteOptions(null)"></textarea>\r\n <mat-autocomplete #actionAutocomplete="matAutocomplete">\r\n <mat-option *ngFor="let option of actionAutocompleteOptions" [value]="option.value">\r\n {{option.label}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class="row mt-2 mb-1">\r\n <div class="col-sm-12 text-right">\r\n <button class="mr-2" mat-raised-button color="primary" (click)="saveActionOnRecord()"\r\n [disabled]="actionOnRecordFormGroup.invalid" type="button">\r\n Salva\r\n </button>\r\n <button class="btn mat-raised-button" (click)="closeDialogActionOnRecord()" type="button">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #dialogInnerForm>\r\n <eqp-dynamic-module-configurator [form]="selectedInnerForm" [innerFormManagment]="true"\r\n (saveFormEvent)="onSaveOrExitInnerForm($event)"></eqp-dynamic-module-configurator>\r\n</ng-template>',styles:["::ng-deep mat-form-field{width:100%}.stepper-header-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.section-list{list-style:none;padding:0}.section-list mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}.danger-color{color:var(--danger)}"]})],e)}(),AttachmentField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),AvailableFileExtensions=[{value:".pdf",key:"application/pdf"},{value:".doc",key:"application/msword"},{value:".xls",key:"application/vnd.ms-excel"},{value:".ppt",key:"application/vnd.ms-powerpoint"},{value:".docx",key:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{value:".xlsx",key:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{value:".pptx",key:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{value:".csv",key:"text/csv"},{value:".txt",key:"text/plain"}],AvailableImageExtensions=[{value:".jpg/.jpeg",key:"image/jpeg"},{value:".png",key:"image/png"},{value:".bmp",key:"image/bmp"},{value:".svg",key:"image/svg+xml"},{value:".ico",key:"image/x-icon"}],BooleanField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),BoolPresentantioEnum;BoolPresentantioEnum=exports.BoolPresentantioEnum||(exports.BoolPresentantioEnum={}),BoolPresentantioEnum[BoolPresentantioEnum.Checkbox=1]="Checkbox",BoolPresentantioEnum[BoolPresentantioEnum.Toggle=2]="Toggle",BoolPresentantioEnum[BoolPresentantioEnum["Radio button"]=3]="Radio button";var DateField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),DateTimeTypeEnum;DateTimeTypeEnum=exports.DateTimeTypeEnum||(exports.DateTimeTypeEnum={}),DateTimeTypeEnum[DateTimeTypeEnum["Solo data"]=1]="Solo data",DateTimeTypeEnum[DateTimeTypeEnum["Solo orario"]=2]="Solo orario",DateTimeTypeEnum[DateTimeTypeEnum["Data e ora"]=3]="Data e ora";var ListValueField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),ListPresentationEnum;ListPresentationEnum=exports.ListPresentationEnum||(exports.ListPresentationEnum={}),ListPresentationEnum[ListPresentationEnum["Combo box"]=1]="Combo box",ListPresentationEnum[ListPresentationEnum["Radio button"]=2]="Radio button",ListPresentationEnum[ListPresentationEnum["Pulsante con testo"]=3]="Pulsante con testo",ListPresentationEnum[ListPresentationEnum.Immagini=4]="Immagini";var AddFormFieldComponent=function(){function e(e,t,o){this.formBuilder=e,this.enumHelper=t,this.dialog=o,this.fieldTypesToExclude=[exports.FieldTypeEnum["Form di dettaglio"]],this.keyValueObject={key:"",value:""},this.availableColSpanSizes=[],this.AvailableFileExtensions=AvailableFileExtensions,this.AvailableImageExtensions=AvailableImageExtensions,this.saveFieldEvent=new core.EventEmitter,this.FieldTypeEnum=exports.FieldTypeEnum,this.BoolPresentantioEnum=exports.BoolPresentantioEnum,this.DateTimeTypeEnum=exports.DateTimeTypeEnum,this.ListPresentationEnum=exports.ListPresentationEnum}return e.prototype.ngOnInit=function(){var e=this;this.fieldTypesToExclude.includes(exports.FieldTypeEnum["Form di dettaglio"])||this.fieldTypesToExclude.push(exports.FieldTypeEnum["Form di dettaglio"]),this.onFieldTypeChange(!1),this.availableFields=this.availableFields?this.availableFields.filter((function(t){return t!=e.field})):[],this.configureColumns()},e.prototype.setFormulaAutocompleteOptions=function(e){e&&e.code.includes("Arrow")||(this.formulaAutocompleteOptions=UtilityHelperService.GetAutocompleteOptions(this.availableFields,this.field.Formula))},e.prototype.createFieldForm=function(){this.fieldFormGroup=this.formBuilder.group({Label:[this.field.Label,forms.Validators.required],Description:[this.field.Description],Required:[this.field.Required],FieldType:[this.field.FieldType,forms.Validators.required],Formula:[this.field.Formula],ColSizes:[this.field.ColSizes],InListView:[this.field.InListView]}),this.formFieldsGroups&&this.fieldFormGroup.addControl("FieldGroup",new forms.FormControl(this.field.FieldGroup,forms.Validators.required))},e.prototype.onFieldTypeChange=function(e){switch(void 0===e&&(e=!0),e&&this.restoreBaseFieldProperties(),this.createFieldForm(),this.onColSizeSelect(),this.fieldTypeFormTemplate=null,this.field.FieldType){case exports.FieldTypeEnum["Campo di testo"]:this.fieldFormGroup.addControl("TextMask",new forms.FormControl(this.field.TextMask)),this.fieldFormGroup.addControl("MaxLenght",new forms.FormControl(this.field.MaxLenght)),this.fieldFormGroup.addControl("MinLenght",new forms.FormControl(this.field.MinLenght)),this.fieldTypeFormTemplate=this.textFieldFormTemplate;break;case exports.FieldTypeEnum["Area di testo"]:this.fieldFormGroup.addControl("Rows",new forms.FormControl(this.field.Rows)),this.fieldFormGroup.addControl("MaxLenght",new forms.FormControl(this.field.MaxLenght)),this.fieldFormGroup.addControl("MinLenght",new forms.FormControl(this.field.MinLenght)),this.fieldTypeFormTemplate=this.textareaFieldFormTemplate;break;case exports.FieldTypeEnum.Booleano:this.fieldFormGroup.addControl("IsTristate",new forms.FormControl(this.field.IsTristate)),this.fieldFormGroup.addControl("PresetationType",new forms.FormControl(this.field.PresetationType,forms.Validators.required)),this.fieldTypeFormTemplate=this.booleadFieldFormTemplate;break;case exports.FieldTypeEnum["Data e/o ora"]:this.fieldFormGroup.addControl("IsOnlyDate",new forms.FormControl(this.field.IsOnlyDate,forms.Validators.required)),this.fieldFormGroup.addControl("MinDate",new forms.FormControl(this.field.MinDate)),this.fieldFormGroup.addControl("MaxDate",new forms.FormControl(this.field.MaxDate)),this.fieldTypeFormTemplate=this.dateFieldFormTemplate;break;case exports.FieldTypeEnum["Campo numerico"]:this.fieldFormGroup.addControl("IsInteger",new forms.FormControl(this.field.IsInteger)),this.fieldFormGroup.addControl("MinValue",new forms.FormControl(this.field.MinValue)),this.fieldFormGroup.addControl("MaxValue",new forms.FormControl(this.field.MaxValue)),this.fieldFormGroup.addControl("NumberFormat",new forms.FormControl(this.field.NumberFormat)),this.fieldFormGroup.addControl("CurrencySymbol",new forms.FormControl(this.field.CurrencySymbol)),this.fieldTypeFormTemplate=this.numericFieldFormTemplate;break;case exports.FieldTypeEnum.Allegato:this.fieldFormGroup.addControl("AllowedExtensions",new forms.FormControl(this.field.AllowedExtensions)),this.fieldFormGroup.addControl("IsMultiAttach",new forms.FormControl(this.field.IsMultiAttach)),this.fieldTypeFormTemplate=this.attachmentFieldFormTemplate;break;case exports.FieldTypeEnum.Immagine:this.field.AttachDefinition=new AttachmentField,this.fieldFormGroup.addControl("IsMultiAttach",new forms.FormControl(this.field.AttachDefinition.IsMultiAttach)),this.fieldFormGroup.addControl("IsMultiPoint",new forms.FormControl(this.field.IsMultiPoint)),this.fieldFormGroup.addControl("AllowedExtensions",new forms.FormControl(this.field.AttachDefinition.AllowedExtensions)),this.fieldFormGroup.addControl("ImageIsContextualAttachment",new forms.FormControl(this.field.ImageIsContextualAttachment)),this.fieldTypeFormTemplate=this.imageFieldFormTemplate;break;case exports.FieldTypeEnum["Elenco generico"]:this.fieldFormGroup.addControl("IsMultiChoiche",new forms.FormControl(this.field.IsMultiChoiche)),this.fieldFormGroup.addControl("PresentationMode",new forms.FormControl(this.field.PresentationMode,forms.Validators.required)),this.fieldTypeFormTemplate=this.listValueFieldFormTemplate;break;case exports.FieldTypeEnum.Lookup:this.fieldFormGroup.addControl("EntitySourceName",new forms.FormControl(this.field.EntitySourceName,forms.Validators.required)),this.fieldFormGroup.addControl("UseAsGetOrDiscard",new forms.FormControl(this.field.UseAsGetOrDiscard)),this.fieldTypeFormTemplate=this.lookupFieldFormTemplate}[exports.FieldTypeEnum.Allegato,exports.FieldTypeEnum.Immagine,exports.FieldTypeEnum["Form di dettaglio"]].includes(this.field.FieldType)?(this.field.Formula=null,this.fieldFormGroup.controls.Formula.disable()):this.fieldFormGroup.controls.Formula.enable()},e.prototype.onColSizeSelect=function(){var e=this.enumHelper.getEnumArray(exports.ColSpanSizesEnum,!1,null),t=this.field.ColSizes?this.field.ColSizes.map((function(e){return exports.ColSpanSizesEnum[e]})):[];this.availableColSpanSizes=e.filter((function(e){return!t.find((function(t){return e.value.includes(t.substring(4,6))&&e.value!=t}))}))},e.prototype.onMultiSelectInputKeyup=function(e,t){if("Enter"===e.code||"NumpadEnter"===e.code){switch(this.field.FieldType){case exports.FieldTypeEnum.Lookup:case exports.FieldTypeEnum.Allegato:this.field[t]||(this.field[t]=new Array),this.field[t].push(e.currentTarget.value);break;case exports.FieldTypeEnum.Immagine:this.field.AttachDefinition[t]||(this.field.AttachDefinition[t]=new Array),this.field.AttachDefinition[t].push(e.currentTarget.value);break;case exports.FieldTypeEnum["Elenco generico"]:if(!this.keyValueObject.key||!this.keyValueObject.value)return;this.field.ValuePairs||(this.field.ValuePairs={}),this.field.ValuePairs[this.keyValueObject.key]=this.keyValueObject.value,this.keyValueObject={key:"",value:""}}e.currentTarget.value=null}},e.prototype.getDictionaryKeyValue=function(){var e=this;return this.field.ValuePairs?Object.keys(this.field.ValuePairs).map((function(t){return{key:t,value:e.field.ValuePairs[t]}})):[]},e.prototype.deleteKeyFromDictionary=function(e){delete this.field.ValuePairs[e]},e.prototype.openMetadataDialog=function(e){void 0===e&&(e=null),e?this.field.FieldType===exports.FieldTypeEnum.Allegato?(this.indexSelectedMetadata=this.field.MetadataFields.indexOf(e),this.selectedMetadata=JSON.parse(JSON.stringify(e))):this.field.FieldType===exports.FieldTypeEnum.Immagine&&(this.indexSelectedMetadata=this.field.AttachDefinition.MetadataFields.indexOf(e),this.selectedMetadata=JSON.parse(JSON.stringify(e))):(this.selectedMetadata=new BaseField,this.indexSelectedMetadata=null),this.dialogMetadataRef=this.dialog.open(this.dialogMetadata,{disableClose:!0,hasBackdrop:!0,width:"75%"})},e.prototype.onSaveMetadata=function(e){var t=this;if(e){if(this.field.FieldType===exports.FieldTypeEnum.Allegato&&this.field.MetadataFields&&this.field.MetadataFields.find((function(o,i){return o.Label===e.Label&&(null==t.indexSelectedMetadata||t.indexSelectedMetadata!==i)}))||this.field.FieldType===exports.FieldTypeEnum.Immagine&&this.field.AttachDefinition.MetadataFields&&this.field.AttachDefinition.MetadataFields.find((function(o,i){return o.Label===e.Label&&(null==t.indexSelectedMetadata||t.indexSelectedMetadata!==i)})))throw EqpDynamicModuleDialogService.Warning("Impossibile inserire due metadata con la stessa label."),new Error("Impossibile inserire due metadata con la stessa label.");null!=this.indexSelectedMetadata&&this.indexSelectedMetadata>=0?this.field.FieldType===exports.FieldTypeEnum.Allegato?this.field.MetadataFields[this.indexSelectedMetadata]=e:this.field.FieldType===exports.FieldTypeEnum.Immagine&&(this.field.AttachDefinition.MetadataFields[this.indexSelectedMetadata]=e):this.field.FieldType===exports.FieldTypeEnum.Allegato?(this.field.MetadataFields||(this.field.MetadataFields=new Array),this.field.MetadataFields.push(e)):this.field.FieldType===exports.FieldTypeEnum.Immagine&&(this.field.AttachDefinition.MetadataFields||(this.field.AttachDefinition.MetadataFields=new Array),this.field.AttachDefinition.MetadataFields.push(e))}this.dialogMetadataRef.close(),this.setMetadataOrdinalPosition(),this.reloadMetadataTable()},e.prototype.disableSaveField=function(){if(this.fieldFormGroup.invalid)return!0;switch(this.field.FieldType){case exports.FieldTypeEnum["Elenco generico"]:return!this.field.ValuePairs||0===this.field.ValuePairs.length;case exports.FieldTypeEnum.Lookup:return!this.field.FieldNames||0===this.field.FieldNames.length;default:return!1}},e.prototype.saveAndExitAddField=function(e){e?this.saveFieldEvent.emit(this.field):this.saveFieldEvent.emit(null)},e.prototype.restoreBaseFieldProperties=function(){if(this.field){var e=JSON.parse(JSON.stringify(this.field));this.field=new BaseField,this.field.Label=e.Label,this.field.Description=e.Description,this.field.Required=e.Required,this.field.FieldType=e.FieldType,this.field.Formula=e.Formula,this.field.ColSizes=e.ColSizes,this.field.FieldGroup=e.FieldGroup}},e.prototype.configureColumns=function(){var e=this;this.metadataColumns=[{key:"action",display:"",type:eqpTable.TypeColumn.MenuAction,buttonMenuIcon:"more_vert",styles:{flex:"0 0 6%"},actions:[{name:"Modifica",icon:"edit",fn:function(t,o,i){return e.openMetadataDialog(t)}},{name:"Elimina",icon:"delete",fn:function(t,o,i){return e.deleteMetadata(t)}}]},{key:"FieldType",display:"Tipologia",type:eqpTable.TypeColumn.Enum,enumModel:exports.FieldTypeEnum},{key:"Label",display:"Label"},{key:"Description",display:"Descrizione"},{key:"Required",display:"Obbligatorio",value:function(e){return!!e.Required},type:eqpTable.TypeColumn.Boolean,booleanValues:{true:'<i class="fa fa-check success-color"></i>',false:'<i class="fa fa-close error-color"></i>'},styles:{flex:"0 0 7%",cellAlignment:eqpTable.CellAlignmentEnum.CENTER}}]},e.prototype.deleteMetadata=function(e){var t=this;EqpDynamicModuleDialogService.Confirm("Eliminare il metadata selezionato?",(function(){t.field.FieldType===exports.FieldTypeEnum.Allegato?t.field.MetadataFields.splice(t.field.MetadataFields.indexOf(e),1):t.field.FieldType===exports.FieldTypeEnum.Immagine&&t.field.AttachDefinition.MetadataFields.splice(t.field.AttachDefinition.MetadataFields.indexOf(e),1),t.setMetadataOrdinalPosition(),t.reloadMetadataTable()}),!1,"Richiesta conferma")},e.prototype.setMetadataOrdinalPosition=function(){var e=this;this.field.FieldType===exports.FieldTypeEnum.Allegato?this.field.MetadataFields&&this.field.MetadataFields.forEach((function(t){t.OrdinalPosition=e.field.MetadataFields.indexOf(t)})):this.field.FieldType===exports.FieldTypeEnum.Immagine&&this.field.AttachDefinition.MetadataFields&&this.field.AttachDefinition.MetadataFields.forEach((function(t){t.OrdinalPosition=e.field.AttachDefinition.MetadataFields.indexOf(t)}))},e.prototype.reloadMetadataTable=function(){this.metadataFieldsTable&&this.metadataFieldsTable.reloadDatatable()},e.ctorParameters=function(){return[{type:forms.FormBuilder},{type:eqpSelect.EnumHelper},{type:dialog.MatDialog}]},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"indexField",void 0),__decorate([core.Input()],e.prototype,"formFieldsGroups",void 0),__decorate([core.Input()],e.prototype,"availableFields",void 0),__decorate([core.Input()],e.prototype,"fieldTypesToExclude",void 0),__decorate([core.Output()],e.prototype,"saveFieldEvent",void 0),__decorate([core.ViewChild("textFieldFormTemplate",{static:!0})],e.prototype,"textFieldFormTemplate",void 0),__decorate([core.ViewChild("textareaFieldFormTemplate",{static:!0})],e.prototype,"textareaFieldFormTemplate",void 0),__decorate([core.ViewChild("booleadFieldFormTemplate",{static:!0})],e.prototype,"booleadFieldFormTemplate",void 0),__decorate([core.ViewChild("dateFieldFormTemplate",{static:!0})],e.prototype,"dateFieldFormTemplate",void 0),__decorate([core.ViewChild("numericFieldFormTemplate",{static:!0})],e.prototype,"numericFieldFormTemplate",void 0),__decorate([core.ViewChild("attachmentFieldFormTemplate",{static:!0})],e.prototype,"attachmentFieldFormTemplate",void 0),__decorate([core.ViewChild("imageFieldFormTemplate",{static:!0})],e.prototype,"imageFieldFormTemplate",void 0),__decorate([core.ViewChild("listValueFieldFormTemplate",{static:!0})],e.prototype,"listValueFieldFormTemplate",void 0),__decorate([core.ViewChild("lookupFieldFormTemplate",{static:!0})],e.prototype,"lookupFieldFormTemplate",void 0),__decorate([core.ViewChild("metadataFieldsTable",{static:!1})],e.prototype,"metadataFieldsTable",void 0),__decorate([core.ViewChild("dialogMetadata",{static:!0})],e.prototype,"dialogMetadata",void 0),e=__decorate([core.Component({selector:"eqp-dynamic-module-add-form-field",template:'<div class="container-fluid" style="max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;">\n <form [formGroup]="fieldFormGroup">\n <div class="row">\n <div class="header-title-standard">{{indexField != null && indexField >= 0 ? "Modifica"\n : "Aggiungi"}} campo</div>\n </div>\n <div class="row">\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [enumData]="FieldTypeEnum" [(ngModelInput)]="field.FieldType" [isRequired]="true"\n [showCancelButton]="false" placeholder="Tipo campo" (ngModelInputChange)="onFieldTypeChange()"\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'FieldType\'"\n [enumDataToExclude]="fieldTypesToExclude">\n </eqp-select>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2">\n <mat-form-field>\n <mat-label> Label </mat-label>\n <input formControlName="Label" required matInput [(ngModel)]="field.Label">\n </mat-form-field>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2">\n <mat-form-field>\n <mat-label> Descrizione </mat-label>\n <input formControlName="Description" required matInput [(ngModel)]="field.Description">\n </mat-form-field>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center">\n <mat-slide-toggle [(ngModel)]="field.Required" formControlName="Required" color="primary">\n Obbligatorio\n </mat-slide-toggle>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2">\n <mat-form-field>\n <mat-label> Formula (Javascript) </mat-label>\n <input formControlName="Formula" matInput [(ngModel)]="field.Formula"\n [matAutocomplete]="formulaAutocomplete" (keyup)="setFormulaAutocompleteOptions($event)"\n (focus)="setFormulaAutocompleteOptions(null)">\n <mat-autocomplete #formulaAutocomplete="matAutocomplete">\n <mat-option *ngFor="let option of formulaAutocompleteOptions" [value]="option.value">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2" *ngIf="formFieldsGroups">\n <eqp-select [arrayData]="formFieldsGroups" [(ngModelInput)]="field.FieldGroup"\n [arrayKeyProperty]="\'Name\'" [arrayValueProperty]="\'Name\'" placeholder="Sezione"\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'FieldGroup\'" [isRequired]="true"\n [includeFullObject]="false">\n </eqp-select>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [arrayData]="availableColSpanSizes" [(ngModelInput)]="field.ColSizes"\n [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'" (ngModelInputChange)="onColSizeSelect()"\n [isMultiSelect]="true" placeholder="Larghezza campo" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'ColSizes\'" [includeFullObject]="false">\n </eqp-select>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center">\n <mat-slide-toggle [(ngModel)]="field.InListView" formControlName="InListView" color="primary">\n Mostrare nella visualizzazione a lista\n </mat-slide-toggle>\n </div>\n\n <ng-container *ngTemplateOutlet="fieldTypeFormTemplate">\n </ng-container>\n </div>\n\n\n <div class="row mt-2 mb-1">\n <div class="col-sm-12 text-right">\n <button class="mr-2" mat-raised-button color="primary" (click)="saveAndExitAddField(true)"\n [disabled]="disableSaveField()" type="button">\n Salva\n </button>\n <button class="btn mat-raised-button" (click)="saveAndExitAddField(false)" type="button">\n Esci\n </button>\n </div>\n </div>\n </form>\n</div>\n\n\n\x3c!-- FORM PROPRIETÀ CAMPI DI TESTO --\x3e\n<ng-template #textFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Maschera </mat-label>\n <input formControlName="TextMask" matInput [(ngModel)]="field.TextMask">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName="MaxLenght" type="number" [min]="0" matInput [(ngModel)]="field.MaxLenght">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName="MinLenght" type="number" [min]="0" matInput [(ngModel)]="field.MinLenght">\n </mat-form-field>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI AREA DI TESTO --\x3e\n<ng-template #textareaFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Righe </mat-label>\n <input formControlName="Rows" type="number" [min]="0" matInput [(ngModel)]="field.Rows">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName="MaxLenght" type="number" [min]="0" matInput [(ngModel)]="field.MaxLenght">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName="MinLenght" type="number" [min]="0" matInput [(ngModel)]="field.MinLenght">\n </mat-form-field>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI BOOLEANI --\x3e\n<ng-template #booleadFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsTristate" formControlName="IsTristate" color="primary">\n A tre stati\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [enumData]="BoolPresentantioEnum" [(ngModelInput)]="field.PresetationType" [isRequired]="true"\n [showCancelButton]="false" placeholder="Tipo di presentazione" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'PresetationType\'">\n </eqp-select>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI DATA --\x3e\n<ng-template #dateFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-datetimepicker [placeholder]="\'Data minima\'" [(ngModelInput)]="field.MinDate"\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'MinDate\'" [UTCDate]="true" [showSeconds]="false">\n </eqp-datetimepicker>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-datetimepicker [placeholder]="\'Data massima\'" [(ngModelInput)]="field.MaxDate"\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'MaxDate\'" [UTCDate]="true" [showSeconds]="false">\n </eqp-datetimepicker>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [enumData]="DateTimeTypeEnum" [(ngModelInput)]="field.IsOnlyDate" [isRequired]="true"\n [showCancelButton]="false" placeholder="Tipo di data" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'IsOnlyDate\'">\n </eqp-select>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI NUMERICI --\x3e\n<ng-template #numericFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsInteger" formControlName="IsInteger" color="primary">\n Valore intero\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Formato numerico </mat-label>\n <input formControlName="NumberFormat" matInput [(ngModel)]="field.NumberFormat">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Simbolo valuta </mat-label>\n <input formControlName="CurrencySymbol" matInput [(ngModel)]="field.CurrencySymbol">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Valore massimo </mat-label>\n <input formControlName="MinValue" type="number" [min]="0" matInput [(ngModel)]="field.MinValue">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Valore minimo </mat-label>\n <input formControlName="MaxValue" type="number" [min]="0" matInput [(ngModel)]="field.MaxValue">\n </mat-form-field>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI ALLEGATO --\x3e\n<ng-template #attachmentFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsMultiAttach" formControlName="IsMultiAttach" color="primary">\n Allegati multipli\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [arrayData]="AvailableFileExtensions.concat(AvailableImageExtensions)"\n [(ngModelInput)]="field.AllowedExtensions" [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'"\n [isMultiSelect]="true" placeholder="Estensioni accettate" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'AllowedExtensions\'" [includeFullObject]="false">\n </eqp-select>\n </div>\n <div class="col-sm-12 mt-2">\n <div class="row mt-2">\n <div class="col-sm-12 col-md-6">\n <div class="header-title-standard">\n Elenco metadata\n </div>\n </div>\n <div class="col-sm-12 col-md-6 text-right">\n <button class="btn btn-primary" mat-raised-button color="primary" type="button"\n (click)="openMetadataDialog()">\n <mat-icon>add</mat-icon>\n <span style="margin-left: 10px;">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]="false" [columns]="metadataColumns"\n [data]="field.MetadataFields" [emptyTableMessage]="\'Nessun metadata inserito\'" [searchText]="\'Cerca\'">\n </eqp-table>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI IMMAGINE --\x3e\n<ng-template #imageFieldFormTemplate>\n \x3c!-- <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Nome immagine </mat-label>\n <input formControlName="ImgName" matInput [(ngModel)]="field.ImgName">\n </mat-form-field>\n </div> --\x3e\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsMultiPoint" formControlName="IsMultiPoint" color="primary">\n Immagine multi-point\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.ImageIsContextualAttachment" formControlName="ImageIsContextualAttachment"\n color="primary">\n Carica immagine come allegato\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.AttachDefinition.IsMultiAttach" formControlName="IsMultiAttach"\n color="primary">\n Immagini multiple\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [arrayData]="AvailableImageExtensions" [(ngModelInput)]="field.AttachDefinition.AllowedExtensions"\n [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'" [isMultiSelect]="true"\n placeholder="Estensioni accettate" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'AllowedExtensions\'" [includeFullObject]="false">\n </eqp-select>\n </div>\n <div class="col-sm-12 mt-2">\n <div class="row mt-2">\n <div class="col-sm-12 col-md-6">\n <div class="header-title-standard">\n Elenco metadata\n </div>\n </div>\n <div class="col-sm-12 col-md-6 text-right">\n <button class="btn btn-primary" mat-raised-button color="primary" type="button"\n (click)="openMetadataDialog()">\n <mat-icon>add</mat-icon>\n <span style="margin-left: 10px;">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]="false" [columns]="metadataColumns"\n [data]="field.AttachDefinition.MetadataFields" [emptyTableMessage]="\'Nessun metadata inserito\'"\n [searchText]="\'Cerca\'">\n </eqp-table>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI LISTA DI VALORI --\x3e\n<ng-template #listValueFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsMultiChoiche" formControlName="IsMultiChoiche" color="primary">\n Scelta multipla\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [enumData]="ListPresentationEnum" [(ngModelInput)]="field.PresentationMode" [isRequired]="true"\n [showCancelButton]="false" placeholder="Tipo di presentazione" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'PresentationMode\'">\n </eqp-select>\n </div>\n <div class="col-sm-12 mt-2">\n <div class="row">\n <h4 class="key-value-list-section-title"> </h4>\n <div class="col-md-4 d-flex align-items-center">\n <mat-form-field>\n <mat-label> Label opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]="keyValueObject.key" (keyup)="onMultiSelectInputKeyup($event, null)">\n </mat-form-field>\n </div>\n <div class="col-md-4 d-flex align-items-center">\n <mat-form-field>\n <mat-label> Valore opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]="keyValueObject.value" (keyup)="onMultiSelectInputKeyup($event, null)">\n </mat-form-field>\n </div>\n <div class="col-md-4 d-flex align-items-center">\n <span class="mr-3">Opzioni inserite:</span>\n <ul class="value-pairs-list">\n <li *ngFor="let keyValuePair of getDictionaryKeyValue()">\n <mat-icon class="mr-1" (click)="deleteKeyFromDictionary(keyValuePair.key)">close\n </mat-icon>\n <span><b>Label: </b> {{keyValuePair.key}} - <b>Valore: </b> {{keyValuePair.value}}</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI LOOKUP --\x3e\n<ng-template #lookupFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.UseAsGetOrDiscard" formControlName="UseAsGetOrDiscard" color="primary"\n matTooltip="Se true la lookup viene visualizzata in una modale per lo scegli scarta">\n Usa per scegli o scarta\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field matTooltip="Nome dell\'entità relazionata">\n <mat-label> Nome entità </mat-label>\n <input formControlName="EntitySourceName" required matInput [(ngModel)]="field.EntitySourceName">\n </mat-form-field>\n </div>\n <div class="col-sm-12 mt-2">\n <div class="row">\n <div class="col-md-4">\n <mat-form-field\n matTooltip="Elenco di campi ordinato che verrà visualizzato nella lookup (premere invio per confermare)">\n <mat-label>\n Nomi dei campi (invio per confermare) </mat-label>\n <input matInput (keyup)="onMultiSelectInputKeyup($event, \'FieldNames\')">\n </mat-form-field>\n </div>\n <div class="col-md-8 d-flex align-items-center">\n <span class="mr-3">Nomi selezionati:</span>\n <div class="extension-container" *ngFor="let extension of field.FieldNames; let i = index">\n <span>{{extension}}</span>\n <mat-icon class="ml-1" (click)="field.FieldNames.splice(i,1)">close\n </mat-icon>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n\n\x3c!-- DIALOG PER AGGIUNGERE UN METADATA NEI CAMPI DI TIPO ALLEGATO O IMMAGINE --\x3e\n<ng-template #dialogMetadata>\n <eqp-dynamic-module-add-form-field [field]="selectedMetadata" [availableFields]="availableFields"\n [indexField]="indexSelectedMetadata" (saveFieldEvent)="onSaveMetadata($event)" [fieldTypesToExclude]="[6,7,10]">\n </eqp-dynamic-module-add-form-field>\n</ng-template>',styles:[".extension-container{display:inline-block;font-size:15px;border:1px solid var(--primary);border-radius:15px;margin-right:10px}.extension-container mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}.extension-container span{margin-left:10px}.key-value-list-section-title{background:linear-gradient(to right,var(--gray) 0,#fff 100%) left bottom #fff no-repeat;background-size:100% 1px}.value-pairs-list{list-style:none;padding:0}.value-pairs-list mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}"]})],e)}(),TextFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"text-field-template",template:'<mat-form-field [formGroup]="field.FormFormGroup">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput type="text" [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled"\r\n [required]="field.Required" [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\r\n</mat-form-field>',styles:[""]})],e)}(),BooleanFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter,this.BoolPresentantioEnum=exports.BoolPresentantioEnum}return e.prototype.ngOnInit=function(){null!=this.record[this.field.Name]&&null!=this.record[this.field.Name]||(this.record[this.field.Name]=!!this.field.IsTristate&&null)},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"boolean-field-template",template:'<div [formGroup]="field.FormFormGroup">\n\n \x3c!-- VISUALIZZAZIONE A TOGGLE --\x3e\n <mat-slide-toggle color="primary" *ngIf="field.PresetationType == BoolPresentantioEnum.Toggle"\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\n {{field.Label + (field.Required ? " *" : "")}}\n </mat-slide-toggle>\n\n\n \x3c!-- VISUALIZZAZIONE A RADIOBUTTON --\x3e\n <mat-label class="mr-3" *ngIf="field.PresetationType == BoolPresentantioEnum[\'Radio button\']">\n {{field.Label + (field.Required ? " *" : "")}}\n </mat-label>\n <mat-radio-group *ngIf="field.PresetationType == BoolPresentantioEnum[\'Radio button\']"\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\n <mat-radio-button class="mr-2" [value]="true" color="primary"> Si </mat-radio-button>\n <mat-radio-button class="mr-2" [value]="false" color="primary"> No </mat-radio-button>\n <mat-radio-button class="mr-2" [value]="null" color="primary" *ngIf="field.IsTristate"> ND\n </mat-radio-button>\n </mat-radio-group>\n\n \x3c!-- VISUALIZZAZIONE A CHECKBOX --\x3e\n <mat-checkbox class="mr-2" *ngIf="field.PresetationType == BoolPresentantioEnum.Checkbox"\n [disabled]="field.FormFormGroup.disabled" [required]="field.Required" [formControlName]="field.Name"\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\n {{field.Label + (field.Required ? " *" : "")}}\n </mat-checkbox>\n\n \x3c!-- TODO: Visualizzazione "Stringa true o false" e "Numerico 0 o 1" ?? --\x3e\n</div>',styles:[""]})],e)}(),DateFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter}return e.prototype.ngOnInit=function(){this.setTimeType()},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.prototype.setTimeType=function(){switch(this.field.IsOnlyDate){case exports.DateTimeTypeEnum["Solo data"]:this.pickerMode=eqpDatetimepicker.PickerModeEnum.DATE;break;case exports.DateTimeTypeEnum["Solo orario"]:this.pickerMode=eqpDatetimepicker.PickerModeEnum.TIME;break;case exports.DateTimeTypeEnum["Data e ora"]:this.pickerMode=eqpDatetimepicker.PickerModeEnum.DATETIME}},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"date-field-template",template:'<eqp-datetimepicker [placeholder]="field.Label" [UTCDate]="true" [pickerMode]="pickerMode"\n [formGroupInput]="field.FormFormGroup" [formControlNameInput]="field.Name"\n [minDate]="field.MinDate ? field.MinDate : null" [maxDate]="field.MaxDate ? field.MaxDate : null"\n [isRequired]="field.Required" [disabled]="field.FormFormGroup.disabled" [(ngModelInput)]="record[field.Name]"\n (ngModelInputChange)="onRecordValueChange()">\n</eqp-datetimepicker>',styles:[""]})],e)}(),TextareaFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"textarea-field-template",template:'<mat-form-field [formGroup]="field.FormFormGroup">\n <textarea matInput [placeholder]="field.Label" [rows]="field.Rows" [formControlName]="field.Name"\n [disabled]="field.FormFormGroup.disabled" [required]="field.Required" [(ngModel)]="record[field.Name]"\n (ngModelChange)="onRecordValueChange()"></textarea>\n</mat-form-field>',styles:[""]})],e)}(),NumericFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter,this.eqpNumericOptions={}}return e.prototype.ngOnInit=function(){this.configureEqpNumericOptions()},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.prototype.configureEqpNumericOptions=function(){this.eqpNumericOptions.prefix=this.field.CurrencySymbol?this.field.CurrencySymbol:"",null!=this.field.MinValue&&null!=this.field.MinValue&&(this.eqpNumericOptions.min=this.field.MinValue),null!=this.field.MaxValue&&null!=this.field.MaxValue&&(this.eqpNumericOptions.max=this.field.MaxValue)},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"numeric-field-template",template:'<mat-form-field [formGroup]="field.FormFormGroup">\n <mat-label> {{field.Label}} </mat-label>\n <input matInput eqpNumericMask [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled"\n [required]="field.Required" [(ngModel)]="record[field.Name]" [options]="eqpNumericOptions"\n [step]="field.IsInteger ? 1 : null" (ngModelChange)="onRecordValueChange()" />\n</mat-form-field>',styles:[""]})],e)}(),ListValueFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter,this.ListPresentationEnum=exports.ListPresentationEnum,this.arrayData=[]}return e.prototype.ngOnInit=function(){this.setArrayData(),this.field.IsMultiChoiche&&!this.record[this.field.Name]&&(this.record[this.field.Name]=[]),this.setFormControlValue()},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.getSelectButtonClass=function(e){return e.Selected?"selected-button":null},e.prototype.buttonSelectClick=function(e){this.field.IsMultiChoiche?(e.Selected=!e.Selected,this.updateSelected(!1)):this.record[this.field.Name]=e.Value,this.onRecordValueChange()},e.prototype.updateSelected=function(e){void 0===e&&(e=!0),this.record[this.field.Name]=this.arrayData.filter((function(e){return e.Selected})).map((function(e){return e.Value})),this.setFormControlValue(),e&&this.onRecordValueChange()},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.prototype.setArrayData=function(){var e=this;Object.keys(this.field.ValuePairs).forEach((function(t){var o;o=e.field.IsMultiChoiche&&e.record[e.field.Name]&&e.record[e.field.Name].length>0?!!e.record[e.field.Name].find((function(o){return o==e.field.ValuePairs[t]})):e.record[e.field.Name]===e.field.ValuePairs[t],e.arrayData.push({Key:t,Value:e.field.ValuePairs[t],Selected:o})}))},e.prototype.setFormControlValue=function(){this.field.FormFormGroup.controls[this.field.Name].setValue(this.record[this.field.Name])},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"list-value-field-template",template:'<eqp-select *ngIf="field.PresentationMode == ListPresentationEnum[\'Combo box\']" [arrayData]="arrayData"\n [arrayKeyProperty]="\'Value\'" [showCancelButton]="!field.Required" [arrayValueProperty]="\'Key\'"\n [formGroupInput]="field.FormFormGroup" [formControlNameInput]="field.Name" [placeholder]="field.Label"\n [includeFullObject]="false" [isRequired]="field.Required" [isDisabled]="field.FormFormGroup.disabled"\n [(ngModelInput)]="record[field.Name]" [isMultiSelect]="field.IsMultiChoiche"\n (ngModelInputChange)="onRecordValueChange()">\n</eqp-select>\n\n<div *ngIf="field.PresentationMode != ListPresentationEnum[\'Combo box\']" [formGroup]="field.FormFormGroup">\n\n <mat-label class="mr-3"> {{field.Label + (field.Required ? " *" : "")}} </mat-label>\n\n \x3c!-- VISUALIZZAZIONE A RADIO BUTTON (SENZA SELEZIONE MULTIPLA) --\x3e\n <mat-radio-group *ngIf="field.PresentationMode == ListPresentationEnum[\'Radio button\'] && !field.IsMultiChoiche"\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\n <mat-radio-button class="mr-2" *ngFor="let data of arrayData" [value]="data.Value" color="primary">\n {{data.Key}}\n </mat-radio-button>\n </mat-radio-group>\n\n \x3c!-- VISUALIZZAZIONE A CHECKBOX (SELEZIONE MULTIPLA) --\x3e\n <div class="d-inline-block"\n *ngIf="field.PresentationMode == ListPresentationEnum[\'Radio button\'] && field.IsMultiChoiche">\n <mat-checkbox class="mr-2" *ngFor="let data of arrayData" [disabled]="field.FormFormGroup.disabled"\n [formControlName]="field.Name" [(ngModel)]="data.Selected" (ngModelChange)="updateSelected()">\n {{data.Key}}\n </mat-checkbox>\n </div>\n\n \x3c!-- VISUALIZZAZIONE A PULSANTI (CON TESTO) --\x3e\n <div class="d-inline-block" *ngIf="field.PresentationMode == ListPresentationEnum[\'Pulsante con testo\']">\n <button mat-raised-button color="primary" class="btn btn-primary mr-2" *ngFor="let data of arrayData"\n (click)="buttonSelectClick(data)" [ngClass]="getSelectButtonClass(data)"\n [disabled]="field.FormFormGroup.disabled">\n {{data.Key}}\n </button>\n </div>\n\n \x3c!-- TODO: VISUALIZZAZIONE A PULSANTI (CON IMMAGINI) ?? --\x3e\n</div>',styles:[".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}"]})],e)}(),AttachmentFieldTemplateComponent=function(){function e(e,t){this.utilityService=e,this.cdr=t,this.onlyImages=!1,this.recordChange=new core.EventEmitter,this.metadataFormGroups=new Array,this.previewLabel="Anteprima",this.emptyTableMessage="No record found",this.downloadTooltipPosition="below",this.openLinkLabel="Apri link",this.addButtonLabel="Aggiungi",this.downloadLabel="Download",this.deleteLabel="Elimina",this.fileNameLabel="Nome file",this.uploadFileLabel="Carica file",this.confirmLabel="Conferma",this.abortLabel="Annulla",this.saveLabel="Salva",this.exitLabel="Esci",this.eqpTableSearchText="Cerca...",this.deleteDialogTitle="Attenzione:",this.deleteDialogMessage="Sicuro di voler eliminare questo allegato?",this.noImageSelectedErrorMessage="Nessuna immagine selezionata!"}return e.prototype.ngOnInit=function(){this.setFormControlValue(),this.createMetadataFormGroups(),this.field.MetadataFields&&this.field.MetadataFields.sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0})),this.field.AllowedExtensions||(this.field.AllowedExtensions=AvailableFileExtensions.concat(AvailableImageExtensions).map((function(e){return e.key})))},e.prototype.ngAfterViewInit=function(){this.field.IsMultiAttach&&this.configureMultiAttachmentColumns()},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.catchAttachmentList=function(e){this.record[this.field.Name]=e,this.createMetadataFormGroups(),this.setFormControlValue(),this.onRecordValueChange(),this.cdr.detectChanges()},e.prototype.updateMetadataValidity=function(){this.metadataFormGroups.find((function(e){return e.invalid}))?this.field.FormFormGroup.controls[this.field.Name].setErrors({incorrect:!0}):this.field.FormFormGroup.controls[this.field.Name].setErrors(null),this.onRecordValueChange()},e.prototype.getFieldFromMetadata=function(e,t){var o=JSON.parse(JSON.stringify(this.field.MetadataFields.find((function(t){return t.Name===e.key}))));return o.FormFormGroup=this.metadataFormGroups[this.record[this.field.Name].indexOf(t)],o},e.prototype.setFormControlValue=function(){this.field.FormFormGroup.controls[this.field.Name].setValue(this.record[this.field.Name])},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.prototype.configureMultiAttachmentColumns=function(){var e=this;this.eqpAttachments&&this.eqpAttachments.attachmentsColumns&&this.field.MetadataFields&&this.field.MetadataFields.length>0&&this.field.MetadataFields.forEach((function(t){e.eqpAttachments.attachmentsColumns.splice(e.eqpAttachments.attachmentsColumns.length-1,0,{key:t.Name,display:t.Label,type:eqpTable.TypeColumn.ExternalTemplate,externalTemplate:e.metadataColumnTemplate})}))},e.prototype.createMetadataFormGroups=function(){var e=this;this.field.MetadataFields&&this.field.MetadataFields.length>0&&(this.metadataFormGroups=[],this.record[this.field.Name]&&this.record[this.field.Name].length>0&&this.record[this.field.Name].forEach((function(t){e.metadataFormGroups.push(e.utilityService.CreateFormFormGroup(e.field.MetadataFields,t,e.field.FormFormGroup.disabled,!e.field.IsMultiAttach))})),this.updateMetadataValidity())},e.ctorParameters=function(){return[{type:UtilityHelperService},{type:core.ChangeDetectorRef}]},__decorate([core.Input()],e.prototype,"onlyImages",void 0),__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),__decorate([core.ViewChild("eqpAttachments",{static:!0})],e.prototype,"eqpAttachments",void 0),__decorate([core.ViewChild("metadataColumnTemplate",{static:!0})],e.prototype,"metadataColumnTemplate",void 0),e=__decorate([core.Component({selector:"attachment-field-template",template:'<p *ngIf="!field.IsMultiAttach" class="mb-2">\n {{field.Label + (field.Required ? " *" : "")}}\n</p>\n<div class="row" *ngIf="!field.IsMultiAttach && record[field.Name] && record[field.Name][0]">\n <div class="mt-2" *ngFor="let metadata of field.MetadataFields" [ngClass]="utilityService.getFieldSyleClass(metadata)">\n <dynamic-module-field [field]="metadata" [record]="record[field.Name][0]"\n (recordChange)="updateMetadataValidity()">\n </dynamic-module-field>\n </div>\n</div>\n\n\n\n<eqp-attachments [attachmentsList]="record[field.Name]" [showMatCard]="true" [allowOnlyImages]="onlyImages"\n [isDisabled]="field.FormFormGroup.disabled" [showInlinePreview]="true" [multipleAttachment]="field.IsMultiAttach"\n [disableAction]="field.FormFormGroup.disabled" [acceptedFileTypes]="field.AllowedExtensions" [showHeader]="true"\n [headerTitle]="field.Label + (field.Required ? \' *\' : \'\')" [previewLabel]="previewLabel"\n [emptyTableMessage]="emptyTableMessage" [downloadTooltipPosition]="downloadTooltipPosition"\n [openLinkLabel]="openLinkLabel" [addButtonLabel]="addButtonLabel" [downloadLabel]="downloadLabel"\n [deleteLabel]="deleteLabel" [fileNameLabel]="fileNameLabel" [uploadFileLabel]="uploadFileLabel"\n [confirmLabel]="confirmLabel" [abortLabel]="abortLabel" [saveLabel]="saveLabel" [exitLabel]="exitLabel"\n [eqpTableSearchText]="eqpTableSearchText" [deleteDialogTitle]="deleteDialogTitle"\n [deleteDialogMessage]="deleteDialogMessage" [noImageSelectedErrorMessage]="noImageSelectedErrorMessage"\n (localEditedAttachments)="catchAttachmentList($event)" #eqpAttachments>\n</eqp-attachments>\n\n\x3c!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS --\x3e\n<ng-template #metadataColumnTemplate let-row="row" let-col="col">\n <dynamic-module-field [field]="getFieldFromMetadata(col, row)" [record]="row"\n (recordChange)="updateMetadataValidity()">\n </dynamic-module-field>\n</ng-template>',styles:[""]})],e)}(),ImageFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter}return e.prototype.ngOnInit=function(){this.field.AttachDefinition.FormFormGroup=this.field.FormFormGroup,this.field.AttachDefinition.AllowedExtensions||(this.field.AttachDefinition.AllowedExtensions=AvailableImageExtensions.map((function(e){return e.key}))),this.field.AttachDefinition.Name=this.field.Name,this.field.AttachDefinition.Label=this.field.Label,this.field.AttachDefinition.Description=this.field.Description,this.field.AttachDefinition.Required=this.field.Required,this.field.AttachDefinition.Formula=this.field.Formula,this.field.AttachDefinition.FieldValue=this.field.FieldValue},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"image-field-template",template:'<attachment-field-template [(record)]="record" [field]="field.AttachDefinition"\n [onlyImages]="true">\n</attachment-field-template>',styles:[""]})],e)}(),ListFormRecordComponent=function(){function ListFormRecordComponent(){this.columns=new Array,this.onAddViewEditRecord=new core.EventEmitter}return ListFormRecordComponent.prototype.ngOnInit=function(){this.configureColumns()},ListFormRecordComponent.prototype.configureColumns=function(){var e=this;this.columns=[{key:"action",display:"",type:eqpTable.TypeColumn.MenuAction,buttonMenuIcon:"more_vert",styles:{flex:"0 0 6%"},actions:[{name:"Visualizza",icon:"info",fn:function(t,o,i){return e.viewOrEditRecord(t,!0)}},{name:"Modifica",icon:"edit",fn:function(t,o,i){return e.viewOrEditRecord(t,!1)}},{name:"Duplica",icon:"file_copy",fn:function(t,o,i){return e.duplicateRecord(t)}},{name:"Elimina",icon:"delete",fn:function(t,o,i){return e.deleteRecord(t)}}]}],this.createAdditionalActions(),this.createColumnsFromFormFields()},ListFormRecordComponent.prototype.createAdditionalActions=function(){var _this=this;this.form.ActionsOnRecord&&this.form.ActionsOnRecord.length>0&&this.form.ActionsOnRecord.sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0})).forEach((function(action){_this.columns.find((function(e){return"action"===e.key})).actions.push({name:action.Name,icon:action.Icon,fn:function(element,index,col){var rec=element,ctx=UtilityHelperService.context;eval(action.Action)}})}))},ListFormRecordComponent.prototype.viewOrEditRecord=function(e,t){this.onAddViewEditRecord.emit({record:e,onlyView:t})},ListFormRecordComponent.prototype.duplicateRecord=function(e){var t=this;EqpDynamicModuleDialogService.Confirm("Duplicare il record selezionato?",(function(){var o=JSON.parse(JSON.stringify(e));isNaN(parseInt(o.ID))?o.ID="xxxxxxxxx".replace("x",(function(e){return(Math.random()+16|0).toString(16)})):o.ID=(parseInt(o.ID)+1).toString(),t.values.push(o),t.reloadTables()}),!1,"Richiesta conferma")},ListFormRecordComponent.prototype.deleteRecord=function(e){var t=this;EqpDynamicModuleDialogService.Confirm("Eliminare il record selezionato?",(function(){t.values.splice(t.values.indexOf(e),1),t.reloadTables()}),!1,"Richiesta conferma")},ListFormRecordComponent.prototype.createColumnsFromFormFields=function(){var e=this;(this.form.Fields.find((function(e){return e.InListView}))?this.form.Fields.filter((function(e){return e.InListView})):this.form.Fields.filter((function(e){return e.OrdinalPosition<6}))).sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0})).forEach((function(t){e.columns.push(e.createFieldColumn(t))}))},ListFormRecordComponent.prototype.createFieldColumn=function(e){var t={key:e.Name,display:e.Label};switch(e.FieldType){case exports.FieldTypeEnum.Booleano:t.type=eqpTable.TypeColumn.Boolean,t.booleanValues={false:'<i class="fa fa-times error-color"></i>',true:'<i class="fa fa-check success-color"></i>'},t.styles={flex:"0 0 7%",cellAlignment:eqpTable.CellAlignmentEnum.CENTER};break;case exports.FieldTypeEnum["Data e/o ora"]:e.IsOnlyDate!=exports.DateTimeTypeEnum["Solo orario"]&&(t.type=eqpTable.TypeColumn.Date,e.IsOnlyDate==exports.DateTimeTypeEnum["Data e ora"]?t.format="dd/MM/yyyy HH:mm":e.IsOnlyDate==exports.DateTimeTypeEnum["Solo data"]&&(t.format="dd/MM/yyyy"));break;case exports.FieldTypeEnum["Campo numerico"]:e.CurrencySymbol?(t.numberPipe=eqpTable.NumberColumnPipe.CURRENCY,t.currencyPipeCode=e.CurrencySymbol):e.IsInteger||(t.numberPipe=eqpTable.NumberColumnPipe.DECIMAL);break;case exports.FieldTypeEnum.Allegato:case exports.FieldTypeEnum.Immagine:t.value=function(t){return e.IsMultiAttach||e.AttachDefinition&&e.AttachDefinition.IsMultiAttach?null!=t[e.Name]&&t[e.Name].length>0?t[e.Name].map((function(e){return e.FileName})).join(", "):null:null!=t[e.Name]&&t[e.Name].length>0?t[e.Name][0].FileName:null},t.isSortable=!1,t.isSearchable=!1;break;case exports.FieldTypeEnum["Elenco generico"]:t.value=function(t){return e.IsMultiChoiche?t[e.Name]&&0!=t[e.Name].length?Object.keys(e.ValuePairs).filter((function(o){return t[e.Name].includes(e.ValuePairs[o])})).join(", "):null:Object.keys(e.ValuePairs).find((function(o){return e.ValuePairs[o]==t[e.Name]}))},t.isSortable=!1,t.isSearchable=!1;break;case exports.FieldTypeEnum.Lookup:}return t},ListFormRecordComponent.prototype.reloadTables=function(){this.tableRecords&&this.tableRecords.reloadDatatable()},__decorate([core.Input()],ListFormRecordComponent.prototype,"form",void 0),__decorate([core.Input()],ListFormRecordComponent.prototype,"values",void 0),__decorate([core.ViewChild("tableRecords",{static:!0})],ListFormRecordComponent.prototype,"tableRecords",void 0),__decorate([core.Output()],ListFormRecordComponent.prototype,"onAddViewEditRecord",void 0),ListFormRecordComponent=__decorate([core.Component({selector:"list-form-record",template:'<div class="row eqp-dynamic-module-title">\r\n <div class="col-md-6">\r\n <h4><b>Elenco {{form.Name}}</b></h4>\r\n </div>\r\n <div class="col-md-6 text-right">\r\n <button class="btn btn-primary" mat-raised-button color="primary" type="button" (click)="onAddViewEditRecord.emit(null)">\r\n <mat-icon>add</mat-icon>\r\n <span style="margin-left: 10px;">Aggiungi</span>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n\r\n<eqp-table #tableRecords [data]="values" [columns]="columns"></eqp-table>',styles:["::ng-deep .error-color{color:var(--danger)}::ng-deep .success-color{color:var(--success)}"]})],ListFormRecordComponent),ListFormRecordComponent}(),Record=function(){},AddFormRecordComponent=function(){function e(e,t){this.cdr=e,this.utilityService=t,this.showButtons=!0,this.form=new Form,this.fieldGroups={},this.FormScalarTypeEnum=exports.FormScalarTypeEnum,this.FieldTypeEnum=exports.FieldTypeEnum,this.saveRecordEvent=new core.EventEmitter}return e.prototype.ngOnInit=function(){null==this.record&&(this.record=new Record),this.createRecordProperties(),this.reorderFormFields(),this.createFormGroup(),this.form.FormScalarType!=exports.FormScalarTypeEnum.Semplice&&this.createFieldGroups(),this.cdr.detectChanges()},e.prototype.onRecordChange=function(){this.fieldTemplate&&this.fieldTemplate.length>0&&this.fieldTemplate.forEach((function(e){return e.updateField()}))},e.prototype.saveOrExitForm=function(e){e?this.saveRecordEvent.emit(null):this.saveRecordEvent.emit(this.record)},e.prototype.createRecordProperties=function(){var e=this,t=Object.keys(this.record);this.form.Fields.forEach((function(o){t.find((function(e){return e===o.Name}))||(e.record[o.Name]=null)})),this.form.InnerForms&&this.form.InnerForms.length>0&&this.form.InnerForms.forEach((function(o){var i=o.Name.split(" ").join("_");t.find((function(e){return e===i}))||(e.record[i]=[])}))},e.prototype.reorderFormFields=function(){this.form.Fields&&this.form.Fields.length>0&&this.form.Fields.sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0}))},e.prototype.createFormGroup=function(){this.formForm=this.utilityService.CreateFormFormGroup(this.form.Fields,this.record,this.onlyView)},e.prototype.createFieldGroups=function(){var e=this;this.form.FormFieldsGroups.sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0})).map((function(e){return e.Name})).forEach((function(t){e.fieldGroups[t]=e.form.Fields.filter((function(e){return e.FieldGroup==t}))}))},e.ctorParameters=function(){return[{type:core.ChangeDetectorRef},{type:UtilityHelperService}]},__decorate([core.Input()],e.prototype,"showButtons",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Input()],e.prototype,"onlyView",void 0),__decorate([core.Output()],e.prototype,"saveRecordEvent",void 0),__decorate([core.ViewChildren("fieldTemplate")],e.prototype,"fieldTemplate",void 0),e=__decorate([core.Component({selector:"add-form-record",template:'<div class="row eqp-dynamic-module-title">\n <div class="col-md-12 text-center">\n <h4><b>{{form.Name}}</b></h4>\n </div>\n</div>\n\n<form [formGroup]="formForm">\n\n \x3c!-- VISUALIZZAZIONE SEMPLICE --\x3e\n <ng-container *ngIf="form.FormScalarType == FormScalarTypeEnum.Semplice" [ngTemplateOutlet]="fieldTemplates"\n [ngTemplateOutletContext]="{ fields: form.Fields }">\n </ng-container>\n\n \x3c!-- VISUALIZZAZIONE A STEPPER --\x3e\n <mat-horizontal-stepper linear *ngIf="form.FormScalarType == FormScalarTypeEnum[\'A step\']">\n <mat-step *ngFor="let group of form.FormFieldsGroups">\n <ng-template matStepLabel>\n {{group.Name}}\n </ng-template>\n\n <ng-container [ngTemplateOutlet]="fieldTemplates"\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\n </ng-container>\n </mat-step>\n </mat-horizontal-stepper>\n\n \x3c!-- VISUALIZZAZIONE A TAB --\x3e\n <mat-tab-group *ngIf="form.FormScalarType == FormScalarTypeEnum[\'In tab\']">\n <mat-tab *ngFor="let group of form.FormFieldsGroups" [label]="group.Name">\n <div class="mt-3">\n <ng-container [ngTemplateOutlet]="fieldTemplates"\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\n </ng-container>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n \x3c!-- VISUALIZZAZIONE AD ACCORDION --\x3e\n <mat-accordion multi *ngIf="form.FormScalarType == FormScalarTypeEnum[\'In accordion\']">\n <mat-expansion-panel *ngFor="let group of form.FormFieldsGroups">\n <mat-expansion-panel-header>\n <mat-panel-title>\n {{group.Name}}\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <ng-container [ngTemplateOutlet]="fieldTemplates"\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\n </ng-container>\n </mat-expansion-panel>\n </mat-accordion>\n</form>\n\n<div class="row mt-2" *ngIf="showButtons">\n <div class="col-sm-12 text-right">\n <button class="mr-2" mat-raised-button (click)="saveOrExitForm(true)" type="button">\n Annulla\n </button>\n <button class="mr-2" mat-raised-button color="primary" (click)="saveOrExitForm(false)"\n [disabled]="formForm.invalid || formForm.disabled" type="button">\n Salva\n </button>\n </div>\n</div>\n\n\x3c!-- TEMPLATE PER LA VISUALIZZAZIONE DEI CAMPI DELLA FORM --\x3e\n<ng-template #fieldTemplates let-fields=\'fields\'>\n <div class="row">\n <div class="mt-2" *ngFor="let field of fields" [ngClass]="utilityService.getFieldSyleClass(field)">\n <dynamic-module-field #fieldTemplate [field]="field" [form]="form" [record]="record" (recordChange)="onRecordChange()"></dynamic-module-field>\n </div>\n </div>\n</ng-template>',styles:[""]})],e)}(),DynamicModuleFieldComponent=function(){function e(e){this.dialog=e,this.recordChange=new core.EventEmitter,this.FieldTypeEnum=exports.FieldTypeEnum,this.onlyViewInnerFormRecord=!1}return e.prototype.updateField=function(){this.fieldTemplate&&this.fieldTemplate.length>0&&this.fieldTemplate.forEach((function(e){return e.updateField()}))},e.prototype.ngOnInit=function(){},e.prototype.onRecordChange=function(){this.recordChange.emit(this.record)},e.prototype.getInnerFormFromField=function(e){return this.form.InnerForms&&this.form.InnerForms.find((function(t){return t.Name==e.Label}))?this.form.InnerForms.find((function(t){return t.Name==e.Label})):null},e.prototype.onAddViewEditInnerFormRecord=function(e,t){this.selectedInnerForm=this.getInnerFormFromField(t),null==e?(this.selectedInnerFormRecord=new Record,this.indexInnerFormRecord=null,this.onlyViewInnerFormRecord=!1):(this.selectedInnerFormRecord=JSON.parse(JSON.stringify(e.record)),this.indexInnerFormRecord=this.record[t.Name].indexOf(e),this.onlyViewInnerFormRecord=e.onlyView),this.dialogInnerFormRecordRef=this.dialog.open(this.dialogInnerFormRecord,{disableClose:!0,hasBackdrop:!0,width:"75%"})},e.prototype.onSaveInnerFormRecord=function(e){if(null!=e){var t=this.selectedInnerForm.Name.split(" ").join("_");null!=this.indexInnerFormRecord&&this.indexInnerFormRecord>=0?this.record[t][this.indexInnerFormRecord]=e:(this.record[t]||(this.record[t]=[]),this.record[t].push(e))}this.dialogInnerFormRecordRef.close(),this.listInnerFormRecords&&this.listInnerFormRecords.length>0&&this.listInnerFormRecords.forEach((function(e){e&&e.tableRecords&&e.tableRecords.reloadDatatable()}))},e.ctorParameters=function(){return[{type:dialog.MatDialog}]},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),__decorate([core.ViewChild("dialogInnerFormRecord",{static:!0})],e.prototype,"dialogInnerFormRecord",void 0),__decorate([core.ViewChildren("fieldTemplate")],e.prototype,"fieldTemplate",void 0),__decorate([core.ViewChildren("listInnerFormRecords")],e.prototype,"listInnerFormRecords",void 0),e=__decorate([core.Component({selector:"dynamic-module-field",template:'<text-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Campo di testo\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</text-field-template>\n\n<textarea-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Area di testo\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</textarea-field-template>\n\n<boolean-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Booleano\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</boolean-field-template>\n\n<date-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Data e/o ora\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</date-field-template>\n\n<numeric-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Campo numerico\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</numeric-field-template>\n\n<list-value-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Elenco generico\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</list-value-field-template>\n\n<attachment-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Allegato\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</attachment-field-template>\n\n<image-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Immagine\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</image-field-template>\n\n<list-form-record #listInnerFormRecords *ngIf="field.FieldType == FieldTypeEnum[\'Form di dettaglio\']"\n [form]="getInnerFormFromField(field)" [values]="record[field.Name]"\n (onAddViewEditRecord)="onAddViewEditInnerFormRecord($event, field)">\n</list-form-record>\n\n\x3c!-- DIALOG PER AGGIUNGERE/MODIFICARE/VISUALIZZARE UN RECORD IN UNA FORM DI DETTAGLIO --\x3e\n<ng-template #dialogInnerFormRecord>\n <add-form-record [form]="selectedInnerForm" [record]="selectedInnerFormRecord" [onlyView]="onlyViewInnerFormRecord"\n (saveRecordEvent)="onSaveInnerFormRecord($event)"></add-form-record>\n</ng-template>',styles:[""]})],e)}(),EqpDynamicModuleModule=function(){function e(){}return e=__decorate([core.NgModule({declarations:[EqpDynamicModuleComponent,EqpDynamicModuleConfiguratorComponent,AddFormFieldComponent,TextFieldTemplateComponent,BooleanFieldTemplateComponent,DateFieldTemplateComponent,TextareaFieldTemplateComponent,NumericFieldTemplateComponent,ListValueFieldTemplateComponent,AttachmentFieldTemplateComponent,ImageFieldTemplateComponent,ListFormRecordComponent,AddFormRecordComponent,DynamicModuleFieldComponent],imports:[platformBrowser.BrowserModule,MaterialModule,forms.FormsModule,common.CommonModule,forms.ReactiveFormsModule,eqpTable.EqpTableModule,eqpAttachments.EqpAttachmentsModule,eqpSelect.EqpSelectModule,eqpDatetimepicker.EqpDatetimepickerModule,eqpFilters.EqpFiltersModule,eqpNumeric.EqpNumericModule],exports:[EqpDynamicModuleComponent,EqpDynamicModuleConfiguratorComponent]})],e)}(),Entity=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseObj),ImageField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),LookupField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),NumericField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),TextareaField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),TextField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField);exports.ActionOnRecord=ActionOnRecord,exports.AddFormFieldComponent=AddFormFieldComponent,exports.AddFormRecordComponent=AddFormRecordComponent,exports.ArrayValidators=ArrayValidators,exports.AttachmentField=AttachmentField,exports.AttachmentFieldTemplateComponent=AttachmentFieldTemplateComponent,exports.AvailableFileExtensions=AvailableFileExtensions,exports.AvailableImageExtensions=AvailableImageExtensions,exports.BaseField=BaseField,exports.BaseObj=BaseObj,exports.BooleanField=BooleanField,exports.BooleanFieldTemplateComponent=BooleanFieldTemplateComponent,exports.Context=Context,exports.ContextUser=ContextUser,exports.DateField=DateField,exports.DateFieldTemplateComponent=DateFieldTemplateComponent,exports.DynamicModuleFieldComponent=DynamicModuleFieldComponent,exports.Entity=Entity,exports.EqpDynamicModuleComponent=EqpDynamicModuleComponent,exports.EqpDynamicModuleConfiguratorComponent=EqpDynamicModuleConfiguratorComponent,exports.EqpDynamicModuleDialogService=EqpDynamicModuleDialogService,exports.EqpDynamicModuleModule=EqpDynamicModuleModule,exports.Form=Form,exports.FormFieldGroup=FormFieldGroup,exports.ImageField=ImageField,exports.ImageFieldTemplateComponent=ImageFieldTemplateComponent,exports.ListFormRecordComponent=ListFormRecordComponent,exports.ListValueField=ListValueField,exports.ListValueFieldTemplateComponent=ListValueFieldTemplateComponent,exports.LookupField=LookupField,exports.NumericField=NumericField,exports.NumericFieldTemplateComponent=NumericFieldTemplateComponent,exports.Record=Record,exports.TextField=TextField,exports.TextFieldTemplateComponent=TextFieldTemplateComponent,exports.TextareaField=TextareaField,exports.TextareaFieldTemplateComponent=TextareaFieldTemplateComponent,exports.UtilityHelperService=UtilityHelperService,exports.ɵa=MaterialModule,Object.defineProperty(exports,"__esModule",{value:!0})}));
16
+ var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(e,t)};function __extends(e,t){function o(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function __rest(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(o[i[r]]=e[i[r]])}return o}function __decorate(e,t,o,i){var r,n=arguments.length,l=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(l=(n<3?r(l):n>3?r(t,o,l):r(t,o))||l);return n>3&&l&&Object.defineProperty(t,o,l),l}function __param(e,t){return function(o,i){t(o,i,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,o,i){return new(o||(o=Promise))((function(r,n){function l(e){try{d(i.next(e))}catch(e){n(e)}}function a(e){try{d(i.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(l,a)}d((i=i.apply(e,t||[])).next())}))}function __generator(e,t){var o,i,r,n,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,i&&(r=2&n[0]?i.return:n[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,n[1])).done)return r;switch(i=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,i=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(!(r=(r=l.trys).length>0&&r[r.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){l.label=n[1];break}if(6===n[0]&&l.label<r[1]){l.label=r[1],r=n;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(n);break}r[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],i=0}finally{o=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}function __createBinding(e,t,o,i){void 0===i&&(i=o),e[i]=t[o]}function __exportStar(e,t){for(var o in e)"default"===o||t.hasOwnProperty(o)||(t[o]=e[o])}function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],i=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var i,r,n=o.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(i=n.next()).done;)l.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}return l}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}function __spreadArrays(){for(var e=0,t=0,o=arguments.length;t<o;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<o;t++)for(var n=arguments[t],l=0,a=n.length;l<a;l++,r++)i[r]=n[l];return i}function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}function __asyncGenerator(e,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=o.apply(e,t||[]),n=[];return i={},l("next"),l("throw"),l("return"),i[Symbol.asyncIterator]=function(){return this},i;function l(e){r[e]&&(i[e]=function(t){return new Promise((function(o,i){n.push([e,t,o,i])>1||a(e,t)}))})}function a(e,t){try{(o=r[e](t)).value instanceof __await?Promise.resolve(o.value.v).then(d,s):m(n[0][2],o)}catch(e){m(n[0][3],e)}var o}function d(e){a("next",e)}function s(e){a("throw",e)}function m(e,t){e(t),n.shift(),n.length&&a(n[0][0],n[0][1])}}function __asyncDelegator(e){var t,o;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,r){t[i]=e[i]?function(t){return(o=!o)?{value:__await(e[i](t)),done:"return"===i}:r?r(t):t}:r}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,o=e[Symbol.asyncIterator];return o?o.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=e[o]&&function(t){return new Promise((function(i,r){(function(e,t,o,i){Promise.resolve(i).then((function(t){e({value:t,done:o})}),t)})(i,r,(t=e[o](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,o){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,o),o}var Context=function(){this.User=new ContextUser},ContextUser=function(){},BaseObj=function(){},Form=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseObj),FormFieldGroup=function(){},ActionOnRecord=function(){},FormTypeEnum,FormScalarTypeEnum;FormTypeEnum=exports.FormTypeEnum||(exports.FormTypeEnum={}),FormTypeEnum[FormTypeEnum.SCALAR=1]="SCALAR",FormTypeEnum[FormTypeEnum.LIST=2]="LIST",FormScalarTypeEnum=exports.FormScalarTypeEnum||(exports.FormScalarTypeEnum={}),FormScalarTypeEnum[FormScalarTypeEnum.Semplice=1]="Semplice",FormScalarTypeEnum[FormScalarTypeEnum["A step"]=2]="A step",FormScalarTypeEnum[FormScalarTypeEnum["In tab"]=3]="In tab",FormScalarTypeEnum[FormScalarTypeEnum["In accordion"]=4]="In accordion";var BaseField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseObj),FieldTypeEnum,ColSpanSizesEnum;FieldTypeEnum=exports.FieldTypeEnum||(exports.FieldTypeEnum={}),FieldTypeEnum[FieldTypeEnum["Campo di testo"]=1]="Campo di testo",FieldTypeEnum[FieldTypeEnum["Area di testo"]=2]="Area di testo",FieldTypeEnum[FieldTypeEnum.Booleano=3]="Booleano",FieldTypeEnum[FieldTypeEnum["Data e/o ora"]=4]="Data e/o ora",FieldTypeEnum[FieldTypeEnum["Campo numerico"]=5]="Campo numerico",FieldTypeEnum[FieldTypeEnum.Allegato=6]="Allegato",FieldTypeEnum[FieldTypeEnum.Immagine=7]="Immagine",FieldTypeEnum[FieldTypeEnum["Elenco generico"]=8]="Elenco generico",FieldTypeEnum[FieldTypeEnum.Lookup=9]="Lookup",FieldTypeEnum[FieldTypeEnum["Form di dettaglio"]=10]="Form di dettaglio",ColSpanSizesEnum=exports.ColSpanSizesEnum||(exports.ColSpanSizesEnum={}),ColSpanSizesEnum[ColSpanSizesEnum["col-sm-3"]=1]="col-sm-3",ColSpanSizesEnum[ColSpanSizesEnum["col-sm-4"]=2]="col-sm-4",ColSpanSizesEnum[ColSpanSizesEnum["col-sm-6"]=3]="col-sm-6",ColSpanSizesEnum[ColSpanSizesEnum["col-sm-12"]=4]="col-sm-12",ColSpanSizesEnum[ColSpanSizesEnum["col-md-3"]=5]="col-md-3",ColSpanSizesEnum[ColSpanSizesEnum["col-md-4"]=6]="col-md-4",ColSpanSizesEnum[ColSpanSizesEnum["col-md-6"]=7]="col-md-6",ColSpanSizesEnum[ColSpanSizesEnum["col-md-12"]=8]="col-md-12",ColSpanSizesEnum[ColSpanSizesEnum["col-lg-3"]=9]="col-lg-3",ColSpanSizesEnum[ColSpanSizesEnum["col-lg-4"]=10]="col-lg-4",ColSpanSizesEnum[ColSpanSizesEnum["col-lg-6"]=11]="col-lg-6",ColSpanSizesEnum[ColSpanSizesEnum["col-lg-12"]=12]="col-lg-12";var ArrayValidators=function(){function e(){}return e.minLenght=function(e){return function(t){return t&&t.value&&Array.isArray(t.value)&&t.value.length>=e?null:{hasMinLenght:!1}}},e.maxLenght=function(e){return function(t){return t&&t.value&&Array.isArray(t.value)&&t.value.length<=e?null:{hasMinLenght:!1}}},e}(),UtilityHelperService=function(){function UtilityHelperService(e){this.formBuilder=e}var UtilityHelperService_1;return UtilityHelperService_1=UtilityHelperService,UtilityHelperService.EvaluateFieldFormula=function(formula,rec,ctx){var evaluatedValue=eval(formula.replace('"','"'));return evaluatedValue||null},UtilityHelperService.SetContext=function(e){this.context=e},UtilityHelperService.GetAutocompleteOptions=function(e,t){var o=[],i=e.map((function(e){return e.Label.split(" ").join("_")}));if(!t||!t.endsWith(".")&&new RegExp("[^0-9a-zA-Z_]").test(t.substring(t.length-1,t.length)))o=[{label:"rec",value:(t||"")+"rec"},{label:"ctx",value:(t||"")+"ctx"}];else if(t.endsWith(".")){var r=t.split(" ")[t.split(" ").length-1].split(".");o="rec"===r[r.length-2]?i.map((function(e){return{label:e,value:t+e}})):"ctx"===r[r.length-2]?Object.keys(UtilityHelperService_1.context).map((function(e){return{label:e,value:t+e}})):r.length>2&&"ctx"===r[r.length-3]&&"User"===r[r.length-2]?Object.keys(UtilityHelperService_1.context.User).map((function(e){return{label:e,value:t+e}})):[]}else{var n=[],l=t.split(" "),a=l[l.length-1];if(!new RegExp("[^0-9a-zA-Z_.]").test(a)){var d=a.split("."),s=d[d.length-1],m=[];1==d.length?m=["rec","ctx"]:d.length>1&&"ctx"===d[d.length-2]?m=Object.keys(UtilityHelperService_1.context):d.length>2&&"ctx"===d[d.length-3]&&"User"===d[d.length-2]?m=Object.keys(UtilityHelperService_1.context.User):d.length>1&&"rec"===d[d.length-2]&&(m=i),m.forEach((function(e){e.startsWith(s)&&n.push({label:e,value:t+e.substring(s.length,e.length)})}))}o=n}return o},UtilityHelperService.prototype.getFieldSyleClass=function(e){if(e.ColSpanSizes&&e.ColSpanSizes.length>0)return e.ColSpanSizes.map((function(e){return exports.ColSpanSizesEnum[e].toString()})).join(" ");switch(e.FieldType){case exports.FieldTypeEnum["Campo di testo"]:return"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum["Area di testo"]:return"col-sm-12 col-md-12 col-lg-12";case exports.FieldTypeEnum.Booleano:return"col-sm-12 col-md-4 col-lg-4 d-flex align-items-center";case exports.FieldTypeEnum["Data e/o ora"]:case exports.FieldTypeEnum["Campo numerico"]:return"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum.Allegato:return e.IsMultiAttach||e.MetadataFields&&e.MetadataFields.length>0?"col-sm-12 col-md-12 col-lg-12":"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum.Immagine:return e.AttachDefinition.IsMultiAttach||e.AttachDefinition.MetadataFields&&e.AttachDefinition.MetadataFields.length>0?"col-sm-12 col-md-12 col-lg-12":"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum["Elenco generico"]:case exports.FieldTypeEnum.Lookup:return"col-sm-12 col-md-4 col-lg-4";case exports.FieldTypeEnum["Form di dettaglio"]:return"col-sm-12 col-md-12 col-lg-12"}},UtilityHelperService.prototype.CreateFormFormGroup=function(e,t,o,i){var r=this;void 0===o&&(o=!1),void 0===i&&(i=!0);var n=this.formBuilder.group([]);return e.forEach((function(e){n.addControl(e.Name,r.createFieldFormControl(e,t)),i&&(e.FormFormGroup=n)})),o&&n.disable(),n},UtilityHelperService.prototype.createFieldFormControl=function(e,t){var o=[];switch(e.Required&&o.push(forms.Validators.required),e.FieldType){case exports.FieldTypeEnum["Campo di testo"]:case exports.FieldTypeEnum["Area di testo"]:e.MaxLenght&&o.push(forms.Validators.maxLength(e.MaxLenght)),e.MinLenght&&o.push(forms.Validators.minLength(e.MinLenght));break;case exports.FieldTypeEnum.Allegato:case exports.FieldTypeEnum.Immagine:e.Required&&o.push(ArrayValidators.minLenght(1));break;case exports.FieldTypeEnum["Elenco generico"]:e.IsMultiChoiche&&e.Required&&o.push(ArrayValidators.minLenght(1))}return new forms.FormControl(t[e.Name],o)},UtilityHelperService.context=new Context,UtilityHelperService.ctorParameters=function(){return[{type:forms.FormBuilder}]},UtilityHelperService.ɵprov=core.ɵɵdefineInjectable({factory:function(){return new UtilityHelperService(core.ɵɵinject(forms.FormBuilder))},token:UtilityHelperService,providedIn:"root"}),UtilityHelperService=UtilityHelperService_1=__decorate([core.Injectable({providedIn:"root"})],UtilityHelperService),UtilityHelperService}(),EqpDynamicModuleComponent=function(){function e(){this.context=new Context,this.form=new Form,this.showButtons=!0,this.showTitle=!0,this.viewMode=exports.FormTypeEnum.LIST,this.saveRecord=new core.EventEmitter,this.deleteRecord=new core.EventEmitter,this.duplicateRecord=new core.EventEmitter,this.FormTypeEnum=exports.FormTypeEnum}return e.prototype.ngOnInit=function(){UtilityHelperService.SetContext(this.context)},e.prototype.onAddViewEditRecord=function(e){null!=e?(this.selectedRecord=JSON.parse(JSON.stringify(e.record)),this.onlyView=e.onlyView):(this.selectedRecord=null,this.onlyView=!1),this.viewMode=exports.FormTypeEnum.SCALAR},e.prototype.onSaveForm=function(e){this.saveRecord.emit(e),this.viewMode=exports.FormTypeEnum.LIST},e.prototype.onDuplicateRecord=function(e){this.duplicateRecord.emit(e)},e.prototype.onDeleteRecord=function(e){this.deleteRecord.emit(e)},__decorate([core.Input()],e.prototype,"context",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"values",void 0),__decorate([core.Input()],e.prototype,"showButtons",void 0),__decorate([core.Input()],e.prototype,"showTitle",void 0),__decorate([core.Input()],e.prototype,"viewMode",void 0),__decorate([core.Output()],e.prototype,"saveRecord",void 0),__decorate([core.Output()],e.prototype,"deleteRecord",void 0),__decorate([core.Output()],e.prototype,"duplicateRecord",void 0),e=__decorate([core.Component({selector:"eqp-dynamic-module",template:'<add-form-record *ngIf="viewMode == FormTypeEnum.SCALAR" [form]="form" [record]="selectedRecord"\r\n [showButtons]="showButtons" [onlyView]="onlyView" (saveRecordEvent)="onSaveForm($event)" [showTitle]="showTitle">\r\n</add-form-record>\r\n\r\n<list-form-record *ngIf="viewMode == FormTypeEnum.LIST" [form]="form" [values]="values"\r\n (onAddViewEditRecord)="onAddViewEditRecord($event)" [showTitle]="showTitle"\r\n (onDeleteRecord)="onDeleteRecord($event)" (onDuplicateRecord)="onDuplicateRecord($event)">\r\n</list-form-record>',styles:["::ng-deep mat-form-field{width:100%}"]})],e)}(),MaterialModule=function(){function e(){}return e=__decorate([core.NgModule({imports:[checkbox.MatCheckboxModule,button.MatButtonModule,input.MatInputModule,autocomplete.MatAutocompleteModule,datepicker.MatDatepickerModule,formField.MatFormFieldModule,radio.MatRadioModule,select.MatSelectModule,slider.MatSliderModule,slideToggle.MatSlideToggleModule,menu.MatMenuModule,sidenav.MatSidenavModule,toolbar.MatToolbarModule,list.MatListModule,gridList.MatGridListModule,card.MatCardModule,stepper.MatStepperModule,tabs.MatTabsModule,expansion.MatExpansionModule,buttonToggle.MatButtonToggleModule,chips.MatChipsModule,icon.MatIconModule,progressSpinner.MatProgressSpinnerModule,progressBar.MatProgressBarModule,dialog.MatDialogModule,tooltip.MatTooltipModule,snackBar.MatSnackBarModule,table.MatTableModule,sort.MatSortModule,paginator.MatPaginatorModule,datepicker.MatDatepickerModule,core$1.MatNativeDateModule],exports:[checkbox.MatCheckboxModule,button.MatButtonModule,input.MatInputModule,autocomplete.MatAutocompleteModule,datepicker.MatDatepickerModule,formField.MatFormFieldModule,radio.MatRadioModule,select.MatSelectModule,slider.MatSliderModule,slideToggle.MatSlideToggleModule,menu.MatMenuModule,sidenav.MatSidenavModule,toolbar.MatToolbarModule,list.MatListModule,gridList.MatGridListModule,card.MatCardModule,stepper.MatStepperModule,tabs.MatTabsModule,expansion.MatExpansionModule,buttonToggle.MatButtonToggleModule,chips.MatChipsModule,icon.MatIconModule,progressSpinner.MatProgressSpinnerModule,progressBar.MatProgressBarModule,dialog.MatDialogModule,tooltip.MatTooltipModule,snackBar.MatSnackBarModule,table.MatTableModule,sort.MatSortModule,paginator.MatPaginatorModule]})],e)}(),EqpDynamicModuleDialogService=function(){function e(){}return e.Error=function(e,t){void 0===t&&(t=null);var o=null!=t?t:"Errore";if(Array.isArray(e)){o=null!=t?t:"Errore";var i=e.join("<br>");Swal.fire({title:o,html:i,icon:"error"})}else Swal.fire(o,e,"error")},e.Confirm=function(e,t,o,i,r){void 0===o&&(o=!1),void 0===i&&(i=null),void 0===r&&(r=null);var n=null!=i?i:"Sei sicuro di voler procedere?";if(Array.isArray(e)){var l=e.join("<br>");Swal.fire({title:n,html:l,width:r||"32rem",icon:o?"warning":"question",showCancelButton:!0,allowOutsideClick:!1,allowEscapeKey:!1}).then((function(e){e.value&&t&&t()}))}else Swal.fire({title:n,text:e,width:r||"32rem",icon:o?"warning":"question",showCancelButton:!0,allowOutsideClick:!1,allowEscapeKey:!1}).then((function(e){e.value&&t&&t()}))},e.Info=function(e,t,o){void 0===t&&(t=null),void 0===o&&(o=null);var i=null!=t?t:"Informazione:";Swal.fire(i,e,"info")},e.Warning=function(e,t,o){void 0===t&&(t=null),void 0===o&&(o=null);var i=null!=t?t:"Attenzione!";if(Array.isArray(e)){var r=e.join("<br>");Swal.fire({title:i,html:r,icon:"warning"})}else Swal.fire(i,e,"warning")},e.ɵprov=core.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=__decorate([core.Injectable({providedIn:"root"})],e)}(),EqpDynamicModuleConfiguratorComponent=function(){function e(e,t){this.formBuilder=e,this.dialog=t,this.context=new Context,this.form=new Form,this.innerFormManagment=!1,this.formCompleted=!1,this.FormTypeEnum=exports.FormTypeEnum,this.FormScalarTypeEnum=exports.FormScalarTypeEnum,this.saveFormEvent=new core.EventEmitter}return e.prototype.ngOnInit=function(){this.context&&UtilityHelperService.SetContext(this.context),this.configureColumns(),this.createFormForm()},e.prototype.onChangeFormScalarType=function(){this.form.FormScalarType!=exports.FormScalarTypeEnum.Semplice?this.formFormGroup.contains("FormFieldsGroups")||(this.formFormGroup.removeControl("FormFieldsGroups"),this.formFormGroup.addControl("FormFieldsGroups",new forms.FormControl(this.form.FormFieldsGroups,[forms.Validators.required,ArrayValidators.minLenght(1)]))):(this.form.FormFieldsGroups=null,this.formFormGroup.contains("FormFieldsGroups")&&this.formFormGroup.removeControl("FormFieldsGroups")),this.formFormGroup.updateValueAndValidity(),this.configureColumns()},e.prototype.onFormFieldGroupNameKeyUp=function(e){var t=this;"Enter"!==e.code&&"NumpadEnter"!==e.code||(this.form.FormFieldsGroups||(this.form.FormFieldsGroups=new Array),this.form.FormFieldsGroups.find((function(e){return e.Name==t.formFieldGroupName}))||this.form.FormFieldsGroups.push({Name:this.formFieldGroupName}),this.formFormGroup.controls.FormFieldsGroups.setValue(this.form.FormFieldsGroups),this.formFieldGroupName=null,this.setFormFieldGroupOrdinalPosition())},e.prototype.onDeleteFormFieldGroupName=function(e){this.form.FormFieldsGroups.splice(this.form.FormFieldsGroups.findIndex((function(t){return t.Name===e})),1),this.formFormGroup.controls.FormFieldsGroups.setValue(this.form.FormFieldsGroups),this.form.Fields.find((function(t){return t.FieldGroup==e}))&&this.form.Fields.filter((function(t){return t.FieldGroup==e})).forEach((function(e){return e.FieldGroup=null})),this.setFormFieldGroupOrdinalPosition()},e.prototype.openFieldDialog=function(e){void 0===e&&(e=null),e?(this.indexSelectedField=this.form.Fields.indexOf(e),this.selectedField=JSON.parse(JSON.stringify(e))):(this.selectedField=new BaseField,this.indexSelectedField=null),this.dialogFieldRef=this.dialog.open(this.dialogField,{disableClose:!0,hasBackdrop:!0,width:"75%"})},e.prototype.onSaveField=function(e){var t=this;if(e){if(this.form.Fields&&this.form.Fields.find((function(o,i){return o.Label===e.Label&&(null==t.indexSelectedField||t.indexSelectedField!==i)})))throw EqpDynamicModuleDialogService.Warning("Impossibile inserire due campi con la stessa label."),new Error("Impossibile inserire due campi con la stessa label.");null!=this.indexSelectedField&&this.indexSelectedField>=0?this.form.Fields[this.indexSelectedField]=e:(this.form.Fields||(this.form.Fields=new Array),this.form.Fields.push(e))}this.closeFieldDialog(),this.setFieldOrdinalPosition(),this.reloadFieldsTable()},e.prototype.isFieldStepCompleted=function(){return!!this.form.Fields&&((this.form.FormScalarType==exports.FormScalarTypeEnum.Semplice||!this.form.Fields.find((function(e){return!e.FieldGroup})))&&this.form.Fields.length>0)},e.prototype.openInnerFormDialog=function(e){void 0===e&&(e=null),e?(this.indexSelectedInnerForm=this.form.InnerForms.indexOf(e),this.selectedInnerForm=JSON.parse(JSON.stringify(e)),this.selectedInnerForm.OldName=e.Name,this.indexSelectedField=this.form.Fields.findIndex((function(t){return t.Label===e.Name}))):(this.selectedInnerForm=new Form,this.indexSelectedInnerForm=null,this.indexSelectedField=null),this.dialogInnerFormRef=this.dialog.open(this.dialogInnerForm,{disableClose:!0,hasBackdrop:!0,width:"85%"})},e.prototype.onSaveOrExitInnerForm=function(e){var t=this;if(null!=e){if(this.form.Name===e.Name||this.form.InnerForms&&this.form.InnerForms.find((function(o,i){return o.Name===e.Name&&(null==t.indexSelectedInnerForm||t.indexSelectedInnerForm!==i)}))||this.form.Fields&&null==this.indexSelectedInnerForm&&this.form.Fields.find((function(o,i){return o.Label===e.Name&&(null==t.indexSelectedField||t.indexSelectedField!==i)})))throw EqpDynamicModuleDialogService.Warning("Impossibile inserire due form di dettaglio con lo stesso nome."),new Error("Impossibile inserire due form di dettaglio con lo stesso nome.");var o=new BaseField;o.Name=e.Name.split(" ").join("_"),o.Label=e.Name,o.FieldType=exports.FieldTypeEnum["Form di dettaglio"],o.FieldGroup=null!=this.indexSelectedField?this.form.Fields[this.indexSelectedField].FieldGroup:null,null!=this.indexSelectedInnerForm&&this.indexSelectedInnerForm>=0?(this.form.InnerForms[this.indexSelectedInnerForm]=e,this.form.Fields[this.indexSelectedField]=o):(this.form.InnerForms||(this.form.InnerForms=new Array),this.form.InnerForms.push(e),this.form.Fields.push(o)),this.reloadFieldsTable()}this.dialogInnerFormRef.close()},e.prototype.openActionOnRecordDialog=function(e){void 0===e&&(e=null),e?(this.indexSelectedAction=this.form.ActionsOnRecord.indexOf(e),this.selectedAction=JSON.parse(JSON.stringify(e))):(this.selectedAction=new ActionOnRecord,this.indexSelectedAction=null),this.createActionOnRecordForm(),this.dialogActionOnRecordRef=this.dialog.open(this.dialogActionOnRecord,{disableClose:!0,hasBackdrop:!0,width:"75%"})},e.prototype.setActionAutocompleteOptions=function(e){e&&e.code.includes("Arrow")||(this.actionAutocompleteOptions=UtilityHelperService.GetAutocompleteOptions(this.form.Fields,this.selectedAction.Action))},e.prototype.saveActionOnRecord=function(){var e=this;if(this.form.ActionsOnRecord&&this.form.ActionsOnRecord.find((function(t,o){return t.Name===e.selectedAction.Name&&(null==e.indexSelectedAction||e.indexSelectedAction!==o)})))throw EqpDynamicModuleDialogService.Warning("Impossibile inserire due action con lo stesso nome."),new Error("Impossibile inserire due action con lo stesso nome.");null!=this.indexSelectedAction&&this.indexSelectedAction>=0?this.form.ActionsOnRecord[this.indexSelectedAction]=this.selectedAction:(this.form.ActionsOnRecord||(this.form.ActionsOnRecord=new Array),this.form.ActionsOnRecord.push(this.selectedAction)),this.closeDialogActionOnRecord(),this.setActionOrdinalPosition(),this.reloadActionsOnRecordTable()},e.prototype.closeDialogActionOnRecord=function(){this.dialogActionOnRecordRef.close()},e.prototype.setFormStatus=function(e){e?(this.formCompleted=!0,this.previewForm=JSON.parse(JSON.stringify(this.form)),this.previewForm.Fields.forEach((function(e){e.Name=e.Label.split(" ").join("_")})),this.previewForm.InnerForms&&this.previewForm.InnerForms.length>0&&this.previewForm.InnerForms.forEach((function(e){e.Fields.forEach((function(e){e.Name=e.Label.split(" ").join("_")}))}))):(this.formCompleted=!1,this.previewForm=null)},e.prototype.saveForm=function(){this.saveFormEvent.emit(this.form)},e.prototype.configureColumns=function(){var e=this;this.fieldsColumns=[{key:"action",display:"",type:eqpTable.TypeColumn.MenuAction,buttonMenuIcon:"more_vert",styles:{flex:"0 0 6%"},actions:[{name:"Modifica",icon:"edit",fn:function(t,o,i){return e.editField(t)}},{name:"Elimina",icon:"delete",fn:function(t,o,i){return e.deleteElement(t,"Fields")}},{name:"Sposta su",icon:"arrow_upward",fn:function(t,o,i){return e.moveElement(t,!0,"Fields")},disabled:function(t){return 0===e.form.Fields.indexOf(t)}},{name:"Sposta giù",icon:"arrow_downward",fn:function(t,o,i){return e.moveElement(t,!1,"Fields")},disabled:function(t){return e.form.Fields.indexOf(t)>=e.form.Fields.length-1}}]},{key:"FieldType",display:"Tipologia",type:eqpTable.TypeColumn.Enum,enumModel:exports.FieldTypeEnum},{key:"Label",display:"Label"},{key:"Description",display:"Descrizione"},{key:"Required",display:"Obbligatorio",value:function(e){return!!e.Required},type:eqpTable.TypeColumn.Boolean,booleanValues:{true:'<i class="fa fa-check success-color"></i>',false:'<i class="fa fa-close error-color"></i>'},styles:{flex:"0 0 7%",cellAlignment:eqpTable.CellAlignmentEnum.CENTER}}],this.form.FormScalarType&&this.form.FormScalarType!=exports.FormScalarTypeEnum.Semplice&&this.fieldsColumns.splice(this.fieldsColumns.findIndex((function(e){return"Description"==e.key})),0,{key:"FieldGroup",display:"Sezione",type:eqpTable.TypeColumn.ExternalTemplate,externalTemplate:this.fieldSectionColumnTemplate}),this.actionsOnRecordColumns=[{key:"action",display:"",type:eqpTable.TypeColumn.MenuAction,buttonMenuIcon:"more_vert",styles:{flex:"0 0 6%"},actions:[{name:"Modifica",icon:"edit",fn:function(t,o,i){return e.openActionOnRecordDialog(t)}},{name:"Elimina",icon:"delete",fn:function(t,o,i){return e.deleteElement(t,"ActionsOnRecord")}},{name:"Sposta su",icon:"arrow_upward",fn:function(t,o,i){return e.moveElement(t,!0,"ActionsOnRecord")},disabled:function(t){return 0===e.form.ActionsOnRecord.indexOf(t)}},{name:"Sposta giù",icon:"arrow_downward",fn:function(t,o,i){return e.moveElement(t,!1,"ActionsOnRecord")},disabled:function(t){return e.form.ActionsOnRecord.indexOf(t)>=e.form.ActionsOnRecord.length-1}}]},{key:"Icon",display:"Icona",styles:{flex:" 0 0 15%"}},{key:"Name",display:"Nome",styles:{flex:" 0 0 20%"}},{key:"Action",display:"Azione"}]},e.prototype.createFormForm=function(){this.formFormGroup=this.formBuilder.group({Name:[this.form.Name,forms.Validators.required],FormScalarType:[this.form.FormScalarType,forms.Validators.required]}),this.onChangeFormScalarType()},e.prototype.createActionOnRecordForm=function(){this.actionOnRecordFormGroup=this.formBuilder.group({Name:[this.selectedAction.Name,forms.Validators.required],Icon:[this.selectedAction.Icon,forms.Validators.required],Action:[this.selectedAction.Action,forms.Validators.required]})},e.prototype.closeFieldDialog=function(){this.dialogFieldRef.close()},e.prototype.editField=function(e){e.FieldType!=exports.FieldTypeEnum["Form di dettaglio"]?this.openFieldDialog(e):this.openInnerFormDialog(this.form.InnerForms.find((function(t){return t.Name==e.Label})))},e.prototype.deleteElement=function(e,t){var o=this;EqpDynamicModuleDialogService.Confirm("Eliminare l'elemento selezionato?",(function(){o.form[t].splice(o.form[t].indexOf(e),1),"Fields"===t?(o.setFieldOrdinalPosition(),o.reloadFieldsTable()):"ActionsOnRecord"===t&&(o.setActionOrdinalPosition(),o.reloadActionsOnRecordTable())}),!1,"Richiesta conferma")},e.prototype.moveElement=function(e,t,o){var i=this.form[o].indexOf(e),r=i+(t?-1:1);this.form[o].splice(i,1),this.form[o].splice(r,0,e),"Fields"===o?(this.setFieldOrdinalPosition(),this.reloadFieldsTable()):"ActionsOnRecord"===o&&(this.setActionOrdinalPosition(),this.reloadActionsOnRecordTable())},e.prototype.setFormFieldGroupOrdinalPosition=function(){this.form.FormFieldsGroups.forEach((function(e,t){return e.OrdinalPosition=t}))},e.prototype.setFieldOrdinalPosition=function(){var e=this;this.form.Fields&&this.form.Fields.forEach((function(t){t.OrdinalPosition=e.form.Fields.indexOf(t)}))},e.prototype.reloadFieldsTable=function(){this.fieldsTable&&this.fieldsTable.reloadDatatable()},e.prototype.setActionOrdinalPosition=function(){var e=this;this.form.ActionsOnRecord&&this.form.ActionsOnRecord.forEach((function(t){t.OrdinalPosition=e.form.ActionsOnRecord.indexOf(t)}))},e.prototype.reloadActionsOnRecordTable=function(){this.actionsOnRecordTable&&this.actionsOnRecordTable.reloadDatatable()},e.ctorParameters=function(){return[{type:forms.FormBuilder},{type:dialog.MatDialog}]},__decorate([core.Input()],e.prototype,"context",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"innerFormManagment",void 0),__decorate([core.ViewChild("fieldsTable",{static:!1})],e.prototype,"fieldsTable",void 0),__decorate([core.ViewChild("dialogField",{static:!0})],e.prototype,"dialogField",void 0),__decorate([core.ViewChild("fieldSectionColumnTemplate",{static:!0})],e.prototype,"fieldSectionColumnTemplate",void 0),__decorate([core.ViewChild("dialogInnerForm",{static:!0})],e.prototype,"dialogInnerForm",void 0),__decorate([core.ViewChild("actionsOnRecordTable",{static:!1})],e.prototype,"actionsOnRecordTable",void 0),__decorate([core.ViewChild("dialogActionOnRecord",{static:!0})],e.prototype,"dialogActionOnRecord",void 0),__decorate([core.Output()],e.prototype,"saveFormEvent",void 0),e=__decorate([core.Component({selector:"eqp-dynamic-module-configurator",template:'<mat-horizontal-stepper linear #stepper>\r\n \x3c!-- DATI GENERALI DELLA FORM --\x3e\r\n <mat-step [stepControl]="formFormGroup">\r\n <form [formGroup]="formFormGroup" (keydown.enter)="false">\r\n <ng-template matStepLabel>\r\n <div class="stepper-header-overlay" (click)="setFormStatus(false)"></div>\r\n Dati generali della form\r\n </ng-template>\r\n\r\n <div class="row">\r\n <div class="col-md-4">\r\n <mat-form-field>\r\n <mat-label>Nome</mat-label>\r\n <input matInput formControlName="Name" [(ngModel)]="form.Name" required>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class="col-md-4">\r\n <eqp-select [enumData]="FormScalarTypeEnum" [(ngModelInput)]="form.FormScalarType"\r\n [isRequired]="true" [showCancelButton]="false" placeholder="Tipo di visualizzazione"\r\n [formGroupInput]="formFormGroup" [formControlNameInput]="\'FormScalarType\'"\r\n (ngModelInputChange)="onChangeFormScalarType()">\r\n </eqp-select>\r\n </div>\r\n </div>\r\n <div class="row" *ngIf="form.FormScalarType && form.FormScalarType != FormScalarTypeEnum.Semplice">\r\n <div class="col-md-4 d-flex align-items-center">\r\n <mat-form-field>\r\n <mat-label> Nome sezione (invio per confermare) </mat-label>\r\n <input matInput [(ngModel)]="formFieldGroupName" [ngModelOptions]="{standalone: true}"\r\n (keyup)="onFormFieldGroupNameKeyUp($event)">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-md-4 d-flex align-items-center">\r\n <span class="mr-3">Sezioni inserite:</span>\r\n <ul class="section-list">\r\n <li *ngFor="let groupName of form.FormFieldsGroups, let i=index">\r\n <mat-icon class="mr-1" (click)="onDeleteFormFieldGroupName(groupName.Name)">close\r\n </mat-icon>\r\n <span> {{i+1}}) {{groupName.Name}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n <div class="mt-2 d-flex justify-content-end">\r\n <button mat-raised-button color="primary" matStepperNext\r\n [disabled]="formFormGroup.invalid">Successivo</button>\r\n </div>\r\n </form>\r\n </mat-step>\r\n\r\n \x3c!-- AGGIUNTA DEI CAMPI DELLA FORM --\x3e\r\n <mat-step [completed]="isFieldStepCompleted()">\r\n <ng-template matStepLabel>\r\n <div class="stepper-header-overlay" (click)="setFormStatus(false)"></div>\r\n Campi da inserire\r\n </ng-template>\r\n\r\n <div class="row justify-content-end">\r\n <button class="btn btn-primary" mat-raised-button color="primary" type="button" (click)="openFieldDialog()">\r\n <mat-icon>add</mat-icon>\r\n <span style="margin-left: 10px;">Aggiungi campo</span>\r\n </button>\r\n\r\n <button class="btn btn-primary ml-2" mat-raised-button color="primary" type="button"\r\n (click)="openInnerFormDialog()" *ngIf="!innerFormManagment">\r\n <mat-icon>add</mat-icon>\r\n <span style="margin-left: 10px;">Aggiungi form di dettaglio</span>\r\n </button>\r\n </div>\r\n\r\n <eqp-table #fieldsTable [createMatCard]="false" [columns]="fieldsColumns" [data]="form.Fields"\r\n [emptyTableMessage]="\'Nessun campo inserito\'" [searchText]="\'Cerca\'">\r\n </eqp-table>\r\n\r\n <div class="mt-2 d-flex justify-content-end">\r\n <button class="mr-2" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color="primary" matStepperNext [disabled]="!isFieldStepCompleted()"\r\n (click)="setFormStatus(false)">Successivo</button>\r\n </div>\r\n </mat-step>\r\n\r\n \x3c!-- AGGIUNTA DELLE OPERAZIONI SUI RECORD --\x3e\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class="stepper-header-overlay" (click)="setFormStatus(false)"></div>\r\n Azioni aggiuntive sui record\r\n </ng-template>\r\n\r\n <div class="row justify-content-end">\r\n <button class="btn btn-primary" mat-raised-button color="primary" type="button"\r\n (click)="openActionOnRecordDialog()">\r\n <mat-icon>add</mat-icon>\r\n <span style="margin-left: 10px;">Aggiungi azione</span>\r\n </button>\r\n </div>\r\n <eqp-table #actionsOnRecordTable [createMatCard]="false" [columns]="actionsOnRecordColumns"\r\n [data]="form.ActionsOnRecord" [emptyTableMessage]="\'Nessuna action inserita\'" [searchText]="\'Cerca\'">\r\n </eqp-table>\r\n\r\n <div class="mt-2 d-flex justify-content-end">\r\n <button class="mr-2" mat-raised-button matStepperPrevious>Precedente</button>\r\n <button mat-raised-button color="primary" matStepperNext (click)="setFormStatus(true)">\r\n Successivo\r\n </button>\r\n </div>\r\n </mat-step>\r\n\r\n \x3c!-- VISUALIZZAZIONE FORM CREATA --\x3e\r\n <mat-step>\r\n <ng-template matStepLabel>\r\n <div class="stepper-header-overlay"\r\n (click)="setFormStatus(formFormGroup.valid && form.Fields && form.Fields.length > 0)"></div>\r\n Riepilogo\r\n </ng-template>\r\n\r\n <eqp-dynamic-module [form]="previewForm" *ngIf="previewForm && formCompleted" [showButtons]="false"\r\n [viewMode]="FormTypeEnum.SCALAR"></eqp-dynamic-module>\r\n\r\n <div class="mt-2 d-flex justify-content-end">\r\n <button class="mr-2" mat-raised-button matStepperPrevious (click)="setFormStatus(false)">Precedente</button>\r\n <button mat-raised-button color="primary" (click)="saveForm()">Salva form</button>\r\n </div>\r\n </mat-step>\r\n</mat-horizontal-stepper>\r\n\r\n<div class="row" *ngIf="innerFormManagment">\r\n <div class="col-md-12 text-right">\r\n <button mat-raised-button (click)="saveFormEvent.emit(null)">Esci</button>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- DIALOG AGGIUNTA/MODIFICA CAMPO --\x3e\r\n<ng-template #dialogField>\r\n <eqp-dynamic-module-add-form-field [field]="selectedField" [indexField]="indexSelectedField"\r\n (saveFieldEvent)="onSaveField($event)" [availableFields]="form.Fields"\r\n [formFieldsGroups]="form.FormScalarType != FormScalarTypeEnum.Semplice ? form.FormFieldsGroups : null">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n\x3c!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS --\x3e\r\n<ng-template #fieldSectionColumnTemplate let-row="row">\r\n <eqp-select [arrayData]="form.FormFieldsGroups" [(ngModelInput)]="row.FieldGroup" [arrayKeyProperty]="\'Name\'"\r\n [arrayValueProperty]="\'Name\'" placeholder="Sezione" [isRequired]="true" [includeFullObject]="false">\r\n </eqp-select>\r\n</ng-template>\r\n\r\n\x3c!-- DIALOG PER AGGIUNGERE/MODIFICARE UNA ACTION SUI RECORD DELLA FORM --\x3e\r\n<ng-template #dialogActionOnRecord>\r\n <div class="container-fluid" style="max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;">\r\n <form [formGroup]="actionOnRecordFormGroup">\r\n <div class="row">\r\n <div class="header-title-standard">{{indexSelectedAction != null && indexSelectedAction >= 0 ?\r\n "Modifica"\r\n : "Aggiungi"}} azione sul record</div>\r\n </div>\r\n <div class="row">\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <mat-form-field>\r\n <mat-label> Nome </mat-label>\r\n <input formControlName="Name" required matInput [(ngModel)]="selectedAction.Name">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <mat-form-field>\r\n <mat-label> Icona </mat-label>\r\n <input formControlName="Icon" required matInput [(ngModel)]="selectedAction.Icon">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n <div class="row">\r\n <div class="col-sm-12 col-md-12 mt-2">\r\n <mat-form-field>\r\n <textarea matInput [placeholder]="\'Azione (Javascript)\'" [rows]="3" formControlName="Action"\r\n required [(ngModel)]="selectedAction.Action" [matAutocomplete]="actionAutocomplete"\r\n (keyup)="setActionAutocompleteOptions($event)"\r\n (focus)="setActionAutocompleteOptions(null)"></textarea>\r\n <mat-autocomplete #actionAutocomplete="matAutocomplete">\r\n <mat-option *ngFor="let option of actionAutocompleteOptions" [value]="option.value">\r\n {{option.label}}\r\n </mat-option>\r\n </mat-autocomplete>\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class="row mt-2 mb-1">\r\n <div class="col-sm-12 text-right">\r\n <button class="mr-2" mat-raised-button color="primary" (click)="saveActionOnRecord()"\r\n [disabled]="actionOnRecordFormGroup.invalid" type="button">\r\n Salva\r\n </button>\r\n <button class="btn mat-raised-button" (click)="closeDialogActionOnRecord()" type="button">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #dialogInnerForm>\r\n <eqp-dynamic-module-configurator [form]="selectedInnerForm" [innerFormManagment]="true"\r\n (saveFormEvent)="onSaveOrExitInnerForm($event)"></eqp-dynamic-module-configurator>\r\n</ng-template>',styles:["::ng-deep mat-form-field{width:100%}.stepper-header-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.section-list{list-style:none;padding:0}.section-list mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}.danger-color{color:var(--danger)}"]})],e)}(),AttachmentField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),AvailableFileExtensions=[{value:".pdf",key:"application/pdf"},{value:".doc",key:"application/msword"},{value:".xls",key:"application/vnd.ms-excel"},{value:".ppt",key:"application/vnd.ms-powerpoint"},{value:".docx",key:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{value:".xlsx",key:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{value:".pptx",key:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{value:".csv",key:"text/csv"},{value:".txt",key:"text/plain"}],AvailableImageExtensions=[{value:".jpg/.jpeg",key:"image/jpeg"},{value:".png",key:"image/png"},{value:".bmp",key:"image/bmp"},{value:".svg",key:"image/svg+xml"},{value:".ico",key:"image/x-icon"}],BooleanField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),BoolPresentantioEnum;BoolPresentantioEnum=exports.BoolPresentantioEnum||(exports.BoolPresentantioEnum={}),BoolPresentantioEnum[BoolPresentantioEnum.Checkbox=1]="Checkbox",BoolPresentantioEnum[BoolPresentantioEnum.Toggle=2]="Toggle",BoolPresentantioEnum[BoolPresentantioEnum["Radio button"]=3]="Radio button";var DateField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),DateTimeTypeEnum;DateTimeTypeEnum=exports.DateTimeTypeEnum||(exports.DateTimeTypeEnum={}),DateTimeTypeEnum[DateTimeTypeEnum["Solo data"]=1]="Solo data",DateTimeTypeEnum[DateTimeTypeEnum["Solo orario"]=2]="Solo orario",DateTimeTypeEnum[DateTimeTypeEnum["Data e ora"]=3]="Data e ora";var ListValueField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),ListPresentationEnum;ListPresentationEnum=exports.ListPresentationEnum||(exports.ListPresentationEnum={}),ListPresentationEnum[ListPresentationEnum["Combo box"]=1]="Combo box",ListPresentationEnum[ListPresentationEnum["Radio button"]=2]="Radio button",ListPresentationEnum[ListPresentationEnum["Pulsante con testo"]=3]="Pulsante con testo",ListPresentationEnum[ListPresentationEnum.Immagini=4]="Immagini";var AddFormFieldComponent=function(){function e(e,t,o){this.formBuilder=e,this.enumHelper=t,this.dialog=o,this.fieldTypesToExclude=[exports.FieldTypeEnum["Form di dettaglio"]],this.keyValueObject={key:"",value:""},this.availableColSpanSizes=[],this.AvailableFileExtensions=AvailableFileExtensions,this.AvailableImageExtensions=AvailableImageExtensions,this.saveFieldEvent=new core.EventEmitter,this.FieldTypeEnum=exports.FieldTypeEnum,this.BoolPresentantioEnum=exports.BoolPresentantioEnum,this.DateTimeTypeEnum=exports.DateTimeTypeEnum,this.ListPresentationEnum=exports.ListPresentationEnum}return e.prototype.ngOnInit=function(){var e=this;this.fieldTypesToExclude.includes(exports.FieldTypeEnum["Form di dettaglio"])||this.fieldTypesToExclude.push(exports.FieldTypeEnum["Form di dettaglio"]),this.onFieldTypeChange(!1),this.availableFields=this.availableFields?this.availableFields.filter((function(t){return t!=e.field})):[],this.configureColumns()},e.prototype.setFormulaAutocompleteOptions=function(e){e&&e.code.includes("Arrow")||(this.formulaAutocompleteOptions=UtilityHelperService.GetAutocompleteOptions(this.availableFields,this.field.Formula))},e.prototype.createFieldForm=function(){this.fieldFormGroup=this.formBuilder.group({Label:[this.field.Label,forms.Validators.required],Description:[this.field.Description],Required:[this.field.Required],FieldType:[this.field.FieldType,forms.Validators.required],Formula:[this.field.Formula],ColSizes:[this.field.ColSizes],InListView:[this.field.InListView]}),this.formFieldsGroups&&this.fieldFormGroup.addControl("FieldGroup",new forms.FormControl(this.field.FieldGroup,forms.Validators.required))},e.prototype.onFieldTypeChange=function(e){switch(void 0===e&&(e=!0),e&&this.restoreBaseFieldProperties(),this.createFieldForm(),this.onColSizeSelect(),this.fieldTypeFormTemplate=null,this.field.FieldType){case exports.FieldTypeEnum["Campo di testo"]:this.fieldFormGroup.addControl("TextMask",new forms.FormControl(this.field.TextMask)),this.fieldFormGroup.addControl("MaxLenght",new forms.FormControl(this.field.MaxLenght)),this.fieldFormGroup.addControl("MinLenght",new forms.FormControl(this.field.MinLenght)),this.fieldTypeFormTemplate=this.textFieldFormTemplate;break;case exports.FieldTypeEnum["Area di testo"]:this.fieldFormGroup.addControl("Rows",new forms.FormControl(this.field.Rows)),this.fieldFormGroup.addControl("MaxLenght",new forms.FormControl(this.field.MaxLenght)),this.fieldFormGroup.addControl("MinLenght",new forms.FormControl(this.field.MinLenght)),this.fieldTypeFormTemplate=this.textareaFieldFormTemplate;break;case exports.FieldTypeEnum.Booleano:this.fieldFormGroup.addControl("IsTristate",new forms.FormControl(this.field.IsTristate)),this.fieldFormGroup.addControl("PresetationType",new forms.FormControl(this.field.PresetationType,forms.Validators.required)),this.fieldTypeFormTemplate=this.booleadFieldFormTemplate;break;case exports.FieldTypeEnum["Data e/o ora"]:this.fieldFormGroup.addControl("IsOnlyDate",new forms.FormControl(this.field.IsOnlyDate,forms.Validators.required)),this.fieldFormGroup.addControl("MinDate",new forms.FormControl(this.field.MinDate)),this.fieldFormGroup.addControl("MaxDate",new forms.FormControl(this.field.MaxDate)),this.fieldTypeFormTemplate=this.dateFieldFormTemplate;break;case exports.FieldTypeEnum["Campo numerico"]:this.fieldFormGroup.addControl("IsInteger",new forms.FormControl(this.field.IsInteger)),this.fieldFormGroup.addControl("MinValue",new forms.FormControl(this.field.MinValue)),this.fieldFormGroup.addControl("MaxValue",new forms.FormControl(this.field.MaxValue)),this.fieldFormGroup.addControl("NumberFormat",new forms.FormControl(this.field.NumberFormat)),this.fieldFormGroup.addControl("CurrencySymbol",new forms.FormControl(this.field.CurrencySymbol)),this.fieldTypeFormTemplate=this.numericFieldFormTemplate;break;case exports.FieldTypeEnum.Allegato:this.fieldFormGroup.addControl("AllowedExtensions",new forms.FormControl(this.field.AllowedExtensions)),this.fieldFormGroup.addControl("IsMultiAttach",new forms.FormControl(this.field.IsMultiAttach)),this.fieldTypeFormTemplate=this.attachmentFieldFormTemplate;break;case exports.FieldTypeEnum.Immagine:this.field.AttachDefinition=new AttachmentField,this.fieldFormGroup.addControl("IsMultiAttach",new forms.FormControl(this.field.AttachDefinition.IsMultiAttach)),this.fieldFormGroup.addControl("IsMultiPoint",new forms.FormControl(this.field.IsMultiPoint)),this.fieldFormGroup.addControl("AllowedExtensions",new forms.FormControl(this.field.AttachDefinition.AllowedExtensions)),this.fieldFormGroup.addControl("ImageIsContextualAttachment",new forms.FormControl(this.field.ImageIsContextualAttachment)),this.fieldTypeFormTemplate=this.imageFieldFormTemplate;break;case exports.FieldTypeEnum["Elenco generico"]:this.fieldFormGroup.addControl("IsMultiChoiche",new forms.FormControl(this.field.IsMultiChoiche)),this.fieldFormGroup.addControl("PresentationMode",new forms.FormControl(this.field.PresentationMode,forms.Validators.required)),this.fieldTypeFormTemplate=this.listValueFieldFormTemplate;break;case exports.FieldTypeEnum.Lookup:this.fieldFormGroup.addControl("EntitySourceName",new forms.FormControl(this.field.EntitySourceName,forms.Validators.required)),this.fieldFormGroup.addControl("UseAsGetOrDiscard",new forms.FormControl(this.field.UseAsGetOrDiscard)),this.fieldTypeFormTemplate=this.lookupFieldFormTemplate}[exports.FieldTypeEnum.Allegato,exports.FieldTypeEnum.Immagine,exports.FieldTypeEnum["Form di dettaglio"]].includes(this.field.FieldType)?(this.field.Formula=null,this.fieldFormGroup.controls.Formula.disable()):this.fieldFormGroup.controls.Formula.enable()},e.prototype.onColSizeSelect=function(){var e=this.enumHelper.getEnumArray(exports.ColSpanSizesEnum,!1,null),t=this.field.ColSizes?this.field.ColSizes.map((function(e){return exports.ColSpanSizesEnum[e]})):[];this.availableColSpanSizes=e.filter((function(e){return!t.find((function(t){return e.value.includes(t.substring(4,6))&&e.value!=t}))}))},e.prototype.onMultiSelectInputKeyup=function(e,t){if("Enter"===e.code||"NumpadEnter"===e.code){switch(this.field.FieldType){case exports.FieldTypeEnum.Lookup:case exports.FieldTypeEnum.Allegato:this.field[t]||(this.field[t]=new Array),this.field[t].push(e.currentTarget.value);break;case exports.FieldTypeEnum.Immagine:this.field.AttachDefinition[t]||(this.field.AttachDefinition[t]=new Array),this.field.AttachDefinition[t].push(e.currentTarget.value);break;case exports.FieldTypeEnum["Elenco generico"]:if(!this.keyValueObject.key||!this.keyValueObject.value)return;this.field.ValuePairs||(this.field.ValuePairs={}),this.field.ValuePairs[this.keyValueObject.key]=this.keyValueObject.value,this.keyValueObject={key:"",value:""}}e.currentTarget.value=null}},e.prototype.getDictionaryKeyValue=function(){var e=this;return this.field.ValuePairs?Object.keys(this.field.ValuePairs).map((function(t){return{key:t,value:e.field.ValuePairs[t]}})):[]},e.prototype.deleteKeyFromDictionary=function(e){delete this.field.ValuePairs[e]},e.prototype.openMetadataDialog=function(e){void 0===e&&(e=null),e?this.field.FieldType===exports.FieldTypeEnum.Allegato?(this.indexSelectedMetadata=this.field.MetadataFields.indexOf(e),this.selectedMetadata=JSON.parse(JSON.stringify(e))):this.field.FieldType===exports.FieldTypeEnum.Immagine&&(this.indexSelectedMetadata=this.field.AttachDefinition.MetadataFields.indexOf(e),this.selectedMetadata=JSON.parse(JSON.stringify(e))):(this.selectedMetadata=new BaseField,this.indexSelectedMetadata=null),this.dialogMetadataRef=this.dialog.open(this.dialogMetadata,{disableClose:!0,hasBackdrop:!0,width:"75%"})},e.prototype.onSaveMetadata=function(e){var t=this;if(e){if(this.field.FieldType===exports.FieldTypeEnum.Allegato&&this.field.MetadataFields&&this.field.MetadataFields.find((function(o,i){return o.Label===e.Label&&(null==t.indexSelectedMetadata||t.indexSelectedMetadata!==i)}))||this.field.FieldType===exports.FieldTypeEnum.Immagine&&this.field.AttachDefinition.MetadataFields&&this.field.AttachDefinition.MetadataFields.find((function(o,i){return o.Label===e.Label&&(null==t.indexSelectedMetadata||t.indexSelectedMetadata!==i)})))throw EqpDynamicModuleDialogService.Warning("Impossibile inserire due metadata con la stessa label."),new Error("Impossibile inserire due metadata con la stessa label.");null!=this.indexSelectedMetadata&&this.indexSelectedMetadata>=0?this.field.FieldType===exports.FieldTypeEnum.Allegato?this.field.MetadataFields[this.indexSelectedMetadata]=e:this.field.FieldType===exports.FieldTypeEnum.Immagine&&(this.field.AttachDefinition.MetadataFields[this.indexSelectedMetadata]=e):this.field.FieldType===exports.FieldTypeEnum.Allegato?(this.field.MetadataFields||(this.field.MetadataFields=new Array),this.field.MetadataFields.push(e)):this.field.FieldType===exports.FieldTypeEnum.Immagine&&(this.field.AttachDefinition.MetadataFields||(this.field.AttachDefinition.MetadataFields=new Array),this.field.AttachDefinition.MetadataFields.push(e))}this.dialogMetadataRef.close(),this.setMetadataOrdinalPosition(),this.reloadMetadataTable()},e.prototype.disableSaveField=function(){if(this.fieldFormGroup.invalid)return!0;switch(this.field.FieldType){case exports.FieldTypeEnum["Elenco generico"]:return!this.field.ValuePairs||0===this.field.ValuePairs.length;case exports.FieldTypeEnum.Lookup:return!this.field.FieldNames||0===this.field.FieldNames.length;default:return!1}},e.prototype.saveAndExitAddField=function(e){e?this.saveFieldEvent.emit(this.field):this.saveFieldEvent.emit(null)},e.prototype.restoreBaseFieldProperties=function(){if(this.field){var e=JSON.parse(JSON.stringify(this.field));this.field=new BaseField,this.field.Label=e.Label,this.field.Description=e.Description,this.field.Required=e.Required,this.field.FieldType=e.FieldType,this.field.Formula=e.Formula,this.field.ColSizes=e.ColSizes,this.field.FieldGroup=e.FieldGroup}},e.prototype.configureColumns=function(){var e=this;this.metadataColumns=[{key:"action",display:"",type:eqpTable.TypeColumn.MenuAction,buttonMenuIcon:"more_vert",styles:{flex:"0 0 6%"},actions:[{name:"Modifica",icon:"edit",fn:function(t,o,i){return e.openMetadataDialog(t)}},{name:"Elimina",icon:"delete",fn:function(t,o,i){return e.deleteMetadata(t)}}]},{key:"FieldType",display:"Tipologia",type:eqpTable.TypeColumn.Enum,enumModel:exports.FieldTypeEnum},{key:"Label",display:"Label"},{key:"Description",display:"Descrizione"},{key:"Required",display:"Obbligatorio",value:function(e){return!!e.Required},type:eqpTable.TypeColumn.Boolean,booleanValues:{true:'<i class="fa fa-check success-color"></i>',false:'<i class="fa fa-close error-color"></i>'},styles:{flex:"0 0 7%",cellAlignment:eqpTable.CellAlignmentEnum.CENTER}}]},e.prototype.deleteMetadata=function(e){var t=this;EqpDynamicModuleDialogService.Confirm("Eliminare il metadata selezionato?",(function(){t.field.FieldType===exports.FieldTypeEnum.Allegato?t.field.MetadataFields.splice(t.field.MetadataFields.indexOf(e),1):t.field.FieldType===exports.FieldTypeEnum.Immagine&&t.field.AttachDefinition.MetadataFields.splice(t.field.AttachDefinition.MetadataFields.indexOf(e),1),t.setMetadataOrdinalPosition(),t.reloadMetadataTable()}),!1,"Richiesta conferma")},e.prototype.setMetadataOrdinalPosition=function(){var e=this;this.field.FieldType===exports.FieldTypeEnum.Allegato?this.field.MetadataFields&&this.field.MetadataFields.forEach((function(t){t.OrdinalPosition=e.field.MetadataFields.indexOf(t)})):this.field.FieldType===exports.FieldTypeEnum.Immagine&&this.field.AttachDefinition.MetadataFields&&this.field.AttachDefinition.MetadataFields.forEach((function(t){t.OrdinalPosition=e.field.AttachDefinition.MetadataFields.indexOf(t)}))},e.prototype.reloadMetadataTable=function(){this.metadataFieldsTable&&this.metadataFieldsTable.reloadDatatable()},e.ctorParameters=function(){return[{type:forms.FormBuilder},{type:eqpSelect.EnumHelper},{type:dialog.MatDialog}]},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"indexField",void 0),__decorate([core.Input()],e.prototype,"formFieldsGroups",void 0),__decorate([core.Input()],e.prototype,"availableFields",void 0),__decorate([core.Input()],e.prototype,"fieldTypesToExclude",void 0),__decorate([core.Output()],e.prototype,"saveFieldEvent",void 0),__decorate([core.ViewChild("textFieldFormTemplate",{static:!0})],e.prototype,"textFieldFormTemplate",void 0),__decorate([core.ViewChild("textareaFieldFormTemplate",{static:!0})],e.prototype,"textareaFieldFormTemplate",void 0),__decorate([core.ViewChild("booleadFieldFormTemplate",{static:!0})],e.prototype,"booleadFieldFormTemplate",void 0),__decorate([core.ViewChild("dateFieldFormTemplate",{static:!0})],e.prototype,"dateFieldFormTemplate",void 0),__decorate([core.ViewChild("numericFieldFormTemplate",{static:!0})],e.prototype,"numericFieldFormTemplate",void 0),__decorate([core.ViewChild("attachmentFieldFormTemplate",{static:!0})],e.prototype,"attachmentFieldFormTemplate",void 0),__decorate([core.ViewChild("imageFieldFormTemplate",{static:!0})],e.prototype,"imageFieldFormTemplate",void 0),__decorate([core.ViewChild("listValueFieldFormTemplate",{static:!0})],e.prototype,"listValueFieldFormTemplate",void 0),__decorate([core.ViewChild("lookupFieldFormTemplate",{static:!0})],e.prototype,"lookupFieldFormTemplate",void 0),__decorate([core.ViewChild("metadataFieldsTable",{static:!1})],e.prototype,"metadataFieldsTable",void 0),__decorate([core.ViewChild("dialogMetadata",{static:!0})],e.prototype,"dialogMetadata",void 0),e=__decorate([core.Component({selector:"eqp-dynamic-module-add-form-field",template:'<div class="container-fluid" style="max-height: 70vh !important; overflow-x: hidden; overflow-y: auto;">\n <form [formGroup]="fieldFormGroup">\n <div class="row">\n <div class="header-title-standard">{{indexField != null && indexField >= 0 ? "Modifica"\n : "Aggiungi"}} campo</div>\n </div>\n <div class="row">\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [enumData]="FieldTypeEnum" [(ngModelInput)]="field.FieldType" [isRequired]="true"\n [showCancelButton]="false" placeholder="Tipo campo" (ngModelInputChange)="onFieldTypeChange()"\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'FieldType\'"\n [enumDataToExclude]="fieldTypesToExclude">\n </eqp-select>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2">\n <mat-form-field>\n <mat-label> Label </mat-label>\n <input formControlName="Label" required matInput [(ngModel)]="field.Label">\n </mat-form-field>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2">\n <mat-form-field>\n <mat-label> Descrizione </mat-label>\n <input formControlName="Description" required matInput [(ngModel)]="field.Description">\n </mat-form-field>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center">\n <mat-slide-toggle [(ngModel)]="field.Required" formControlName="Required" color="primary">\n Obbligatorio\n </mat-slide-toggle>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2">\n <mat-form-field>\n <mat-label> Formula (Javascript) </mat-label>\n <input formControlName="Formula" matInput [(ngModel)]="field.Formula"\n [matAutocomplete]="formulaAutocomplete" (keyup)="setFormulaAutocompleteOptions($event)"\n (focus)="setFormulaAutocompleteOptions(null)">\n <mat-autocomplete #formulaAutocomplete="matAutocomplete">\n <mat-option *ngFor="let option of formulaAutocompleteOptions" [value]="option.value">\n {{option.label}}\n </mat-option>\n </mat-autocomplete>\n </mat-form-field>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2" *ngIf="formFieldsGroups">\n <eqp-select [arrayData]="formFieldsGroups" [(ngModelInput)]="field.FieldGroup"\n [arrayKeyProperty]="\'Name\'" [arrayValueProperty]="\'Name\'" placeholder="Sezione"\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'FieldGroup\'" [isRequired]="true"\n [includeFullObject]="false">\n </eqp-select>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [arrayData]="availableColSpanSizes" [(ngModelInput)]="field.ColSizes"\n [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'" (ngModelInputChange)="onColSizeSelect()"\n [isMultiSelect]="true" placeholder="Larghezza campo" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'ColSizes\'" [includeFullObject]="false">\n </eqp-select>\n </div>\n\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center">\n <mat-slide-toggle [(ngModel)]="field.InListView" formControlName="InListView" color="primary">\n Mostrare nella visualizzazione a lista\n </mat-slide-toggle>\n </div>\n\n <ng-container *ngTemplateOutlet="fieldTypeFormTemplate">\n </ng-container>\n </div>\n\n\n <div class="row mt-2 mb-1">\n <div class="col-sm-12 text-right">\n <button class="mr-2" mat-raised-button color="primary" (click)="saveAndExitAddField(true)"\n [disabled]="disableSaveField()" type="button">\n Salva\n </button>\n <button class="btn mat-raised-button" (click)="saveAndExitAddField(false)" type="button">\n Esci\n </button>\n </div>\n </div>\n </form>\n</div>\n\n\n\x3c!-- FORM PROPRIETÀ CAMPI DI TESTO --\x3e\n<ng-template #textFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Maschera </mat-label>\n <input formControlName="TextMask" matInput [(ngModel)]="field.TextMask">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName="MaxLenght" type="number" [min]="0" matInput [(ngModel)]="field.MaxLenght">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName="MinLenght" type="number" [min]="0" matInput [(ngModel)]="field.MinLenght">\n </mat-form-field>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI AREA DI TESTO --\x3e\n<ng-template #textareaFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Righe </mat-label>\n <input formControlName="Rows" type="number" [min]="0" matInput [(ngModel)]="field.Rows">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Lunghezza massima </mat-label>\n <input formControlName="MaxLenght" type="number" [min]="0" matInput [(ngModel)]="field.MaxLenght">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Lunghezza minima </mat-label>\n <input formControlName="MinLenght" type="number" [min]="0" matInput [(ngModel)]="field.MinLenght">\n </mat-form-field>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI BOOLEANI --\x3e\n<ng-template #booleadFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsTristate" formControlName="IsTristate" color="primary">\n A tre stati\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [enumData]="BoolPresentantioEnum" [(ngModelInput)]="field.PresetationType" [isRequired]="true"\n [showCancelButton]="false" placeholder="Tipo di presentazione" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'PresetationType\'">\n </eqp-select>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI DATA --\x3e\n<ng-template #dateFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-datetimepicker [placeholder]="\'Data minima\'" [(ngModelInput)]="field.MinDate"\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'MinDate\'" [UTCDate]="true" [showSeconds]="false">\n </eqp-datetimepicker>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-datetimepicker [placeholder]="\'Data massima\'" [(ngModelInput)]="field.MaxDate"\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'MaxDate\'" [UTCDate]="true" [showSeconds]="false">\n </eqp-datetimepicker>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [enumData]="DateTimeTypeEnum" [(ngModelInput)]="field.IsOnlyDate" [isRequired]="true"\n [showCancelButton]="false" placeholder="Tipo di data" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'IsOnlyDate\'">\n </eqp-select>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI NUMERICI --\x3e\n<ng-template #numericFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsInteger" formControlName="IsInteger" color="primary">\n Valore intero\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Formato numerico </mat-label>\n <input formControlName="NumberFormat" matInput [(ngModel)]="field.NumberFormat">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Simbolo valuta </mat-label>\n <input formControlName="CurrencySymbol" matInput [(ngModel)]="field.CurrencySymbol">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Valore massimo </mat-label>\n <input formControlName="MinValue" type="number" [min]="0" matInput [(ngModel)]="field.MinValue">\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Valore minimo </mat-label>\n <input formControlName="MaxValue" type="number" [min]="0" matInput [(ngModel)]="field.MaxValue">\n </mat-form-field>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI ALLEGATO --\x3e\n<ng-template #attachmentFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsMultiAttach" formControlName="IsMultiAttach" color="primary">\n Allegati multipli\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [arrayData]="AvailableFileExtensions.concat(AvailableImageExtensions)"\n [(ngModelInput)]="field.AllowedExtensions" [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'"\n [isMultiSelect]="true" placeholder="Estensioni accettate" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'AllowedExtensions\'" [includeFullObject]="false">\n </eqp-select>\n </div>\n <div class="col-sm-12 mt-2">\n <div class="row mt-2">\n <div class="col-sm-12 col-md-6">\n <div class="header-title-standard">\n Elenco metadata\n </div>\n </div>\n <div class="col-sm-12 col-md-6 text-right">\n <button class="btn btn-primary" mat-raised-button color="primary" type="button"\n (click)="openMetadataDialog()">\n <mat-icon>add</mat-icon>\n <span style="margin-left: 10px;">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]="false" [columns]="metadataColumns"\n [data]="field.MetadataFields" [emptyTableMessage]="\'Nessun metadata inserito\'" [searchText]="\'Cerca\'">\n </eqp-table>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI IMMAGINE --\x3e\n<ng-template #imageFieldFormTemplate>\n \x3c!-- <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field>\n <mat-label> Nome immagine </mat-label>\n <input formControlName="ImgName" matInput [(ngModel)]="field.ImgName">\n </mat-form-field>\n </div> --\x3e\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsMultiPoint" formControlName="IsMultiPoint" color="primary">\n Immagine multi-point\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.ImageIsContextualAttachment" formControlName="ImageIsContextualAttachment"\n color="primary">\n Carica immagine come allegato\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.AttachDefinition.IsMultiAttach" formControlName="IsMultiAttach"\n color="primary">\n Immagini multiple\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [arrayData]="AvailableImageExtensions" [(ngModelInput)]="field.AttachDefinition.AllowedExtensions"\n [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'" [isMultiSelect]="true"\n placeholder="Estensioni accettate" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'AllowedExtensions\'" [includeFullObject]="false">\n </eqp-select>\n </div>\n <div class="col-sm-12 mt-2">\n <div class="row mt-2">\n <div class="col-sm-12 col-md-6">\n <div class="header-title-standard">\n Elenco metadata\n </div>\n </div>\n <div class="col-sm-12 col-md-6 text-right">\n <button class="btn btn-primary" mat-raised-button color="primary" type="button"\n (click)="openMetadataDialog()">\n <mat-icon>add</mat-icon>\n <span style="margin-left: 10px;">Aggiungi</span>\n </button>\n </div>\n </div>\n <eqp-table #metadataFieldsTable [createMatCard]="false" [columns]="metadataColumns"\n [data]="field.AttachDefinition.MetadataFields" [emptyTableMessage]="\'Nessun metadata inserito\'"\n [searchText]="\'Cerca\'">\n </eqp-table>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI LISTA DI VALORI --\x3e\n<ng-template #listValueFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.IsMultiChoiche" formControlName="IsMultiChoiche" color="primary">\n Scelta multipla\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2">\n <eqp-select [enumData]="ListPresentationEnum" [(ngModelInput)]="field.PresentationMode" [isRequired]="true"\n [showCancelButton]="false" placeholder="Tipo di presentazione" [formGroupInput]="fieldFormGroup"\n [formControlNameInput]="\'PresentationMode\'">\n </eqp-select>\n </div>\n <div class="col-sm-12 mt-2">\n <div class="row">\n <h4 class="key-value-list-section-title"> </h4>\n <div class="col-md-4 d-flex align-items-center">\n <mat-form-field>\n <mat-label> Label opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]="keyValueObject.key" (keyup)="onMultiSelectInputKeyup($event, null)">\n </mat-form-field>\n </div>\n <div class="col-md-4 d-flex align-items-center">\n <mat-form-field>\n <mat-label> Valore opzione (invio per confermare)</mat-label>\n <input matInput [(ngModel)]="keyValueObject.value" (keyup)="onMultiSelectInputKeyup($event, null)">\n </mat-form-field>\n </div>\n <div class="col-md-4 d-flex align-items-center">\n <span class="mr-3">Opzioni inserite:</span>\n <ul class="value-pairs-list">\n <li *ngFor="let keyValuePair of getDictionaryKeyValue()">\n <mat-icon class="mr-1" (click)="deleteKeyFromDictionary(keyValuePair.key)">close\n </mat-icon>\n <span><b>Label: </b> {{keyValuePair.key}} - <b>Valore: </b> {{keyValuePair.value}}</span>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-template>\n\n\x3c!-- FORM PROPRIETÀ CAMPI LOOKUP --\x3e\n<ng-template #lookupFieldFormTemplate>\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.UseAsGetOrDiscard" formControlName="UseAsGetOrDiscard" color="primary"\n matTooltip="Se true la lookup viene visualizzata in una modale per lo scegli scarta">\n Usa per scegli o scarta\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\n <mat-form-field matTooltip="Nome dell\'entità relazionata">\n <mat-label> Nome entità </mat-label>\n <input formControlName="EntitySourceName" required matInput [(ngModel)]="field.EntitySourceName">\n </mat-form-field>\n </div>\n <div class="col-sm-12 mt-2">\n <div class="row">\n <div class="col-md-4">\n <mat-form-field\n matTooltip="Elenco di campi ordinato che verrà visualizzato nella lookup (premere invio per confermare)">\n <mat-label>\n Nomi dei campi (invio per confermare) </mat-label>\n <input matInput (keyup)="onMultiSelectInputKeyup($event, \'FieldNames\')">\n </mat-form-field>\n </div>\n <div class="col-md-8 d-flex align-items-center">\n <span class="mr-3">Nomi selezionati:</span>\n <div class="extension-container" *ngFor="let extension of field.FieldNames; let i = index">\n <span>{{extension}}</span>\n <mat-icon class="ml-1" (click)="field.FieldNames.splice(i,1)">close\n </mat-icon>\n </div>\n </div>\n </div>\n </div>\n</ng-template>\n\n\x3c!-- DIALOG PER AGGIUNGERE UN METADATA NEI CAMPI DI TIPO ALLEGATO O IMMAGINE --\x3e\n<ng-template #dialogMetadata>\n <eqp-dynamic-module-add-form-field [field]="selectedMetadata" [availableFields]="availableFields"\n [indexField]="indexSelectedMetadata" (saveFieldEvent)="onSaveMetadata($event)" [fieldTypesToExclude]="[6,7,10]">\n </eqp-dynamic-module-add-form-field>\n</ng-template>',styles:[".extension-container{display:inline-block;font-size:15px;border:1px solid var(--primary);border-radius:15px;margin-right:10px}.extension-container mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}.extension-container span{margin-left:10px}.key-value-list-section-title{background:linear-gradient(to right,var(--gray) 0,#fff 100%) left bottom #fff no-repeat;background-size:100% 1px}.value-pairs-list{list-style:none;padding:0}.value-pairs-list mat-icon{vertical-align:middle;font-size:15px;height:15px;width:15px;color:var(--danger);margin-right:10px;cursor:pointer}"]})],e)}(),TextFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"text-field-template",template:'<mat-form-field [formGroup]="field.FormFormGroup">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput type="text" [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled"\r\n [required]="field.Required" [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\r\n</mat-form-field>',styles:[""]})],e)}(),BooleanFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter,this.BoolPresentantioEnum=exports.BoolPresentantioEnum}return e.prototype.ngOnInit=function(){null!=this.record[this.field.Name]&&null!=this.record[this.field.Name]||(this.record[this.field.Name]=!!this.field.IsTristate&&null)},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"boolean-field-template",template:'<div [formGroup]="field.FormFormGroup">\n\n \x3c!-- VISUALIZZAZIONE A TOGGLE --\x3e\n <mat-slide-toggle color="primary" *ngIf="field.PresetationType == BoolPresentantioEnum.Toggle"\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\n {{field.Label + (field.Required ? " *" : "")}}\n </mat-slide-toggle>\n\n\n \x3c!-- VISUALIZZAZIONE A RADIOBUTTON --\x3e\n <mat-label class="mr-3" *ngIf="field.PresetationType == BoolPresentantioEnum[\'Radio button\']">\n {{field.Label + (field.Required ? " *" : "")}}\n </mat-label>\n <mat-radio-group *ngIf="field.PresetationType == BoolPresentantioEnum[\'Radio button\']"\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\n <mat-radio-button class="mr-2" [value]="true" color="primary"> Si </mat-radio-button>\n <mat-radio-button class="mr-2" [value]="false" color="primary"> No </mat-radio-button>\n <mat-radio-button class="mr-2" [value]="null" color="primary" *ngIf="field.IsTristate"> ND\n </mat-radio-button>\n </mat-radio-group>\n\n \x3c!-- VISUALIZZAZIONE A CHECKBOX --\x3e\n <mat-checkbox class="mr-2" *ngIf="field.PresetationType == BoolPresentantioEnum.Checkbox"\n [disabled]="field.FormFormGroup.disabled" [required]="field.Required" [formControlName]="field.Name"\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\n {{field.Label + (field.Required ? " *" : "")}}\n </mat-checkbox>\n\n \x3c!-- TODO: Visualizzazione "Stringa true o false" e "Numerico 0 o 1" ?? --\x3e\n</div>',styles:[""]})],e)}(),DateFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter}return e.prototype.ngOnInit=function(){this.setTimeType()},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.prototype.setTimeType=function(){switch(this.field.IsOnlyDate){case exports.DateTimeTypeEnum["Solo data"]:this.pickerMode=eqpDatetimepicker.PickerModeEnum.DATE;break;case exports.DateTimeTypeEnum["Solo orario"]:this.pickerMode=eqpDatetimepicker.PickerModeEnum.TIME;break;case exports.DateTimeTypeEnum["Data e ora"]:this.pickerMode=eqpDatetimepicker.PickerModeEnum.DATETIME}},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"date-field-template",template:'<eqp-datetimepicker [placeholder]="field.Label" [UTCDate]="true" [pickerMode]="pickerMode"\n [formGroupInput]="field.FormFormGroup" [formControlNameInput]="field.Name"\n [minDate]="field.MinDate ? field.MinDate : null" [maxDate]="field.MaxDate ? field.MaxDate : null"\n [isRequired]="field.Required" [disabled]="field.FormFormGroup.disabled" [(ngModelInput)]="record[field.Name]"\n (ngModelInputChange)="onRecordValueChange()">\n</eqp-datetimepicker>',styles:[""]})],e)}(),TextareaFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"textarea-field-template",template:'<mat-form-field [formGroup]="field.FormFormGroup">\n <textarea matInput [placeholder]="field.Label" [rows]="field.Rows" [formControlName]="field.Name"\n [disabled]="field.FormFormGroup.disabled" [required]="field.Required" [(ngModel)]="record[field.Name]"\n (ngModelChange)="onRecordValueChange()"></textarea>\n</mat-form-field>',styles:[""]})],e)}(),NumericFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter,this.eqpNumericOptions={}}return e.prototype.ngOnInit=function(){this.configureEqpNumericOptions()},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.prototype.configureEqpNumericOptions=function(){this.eqpNumericOptions.prefix=this.field.CurrencySymbol?this.field.CurrencySymbol:"",null!=this.field.MinValue&&null!=this.field.MinValue&&(this.eqpNumericOptions.min=this.field.MinValue),null!=this.field.MaxValue&&null!=this.field.MaxValue&&(this.eqpNumericOptions.max=this.field.MaxValue)},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"numeric-field-template",template:'<mat-form-field [formGroup]="field.FormFormGroup">\n <mat-label> {{field.Label}} </mat-label>\n <input matInput eqpNumericMask [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled"\n [required]="field.Required" [(ngModel)]="record[field.Name]" [options]="eqpNumericOptions"\n [step]="field.IsInteger ? 1 : null" (ngModelChange)="onRecordValueChange()" />\n</mat-form-field>',styles:[""]})],e)}(),ListValueFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter,this.ListPresentationEnum=exports.ListPresentationEnum,this.arrayData=[]}return e.prototype.ngOnInit=function(){this.setArrayData(),this.field.IsMultiChoiche&&!this.record[this.field.Name]&&(this.record[this.field.Name]=[]),this.setFormControlValue()},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.getSelectButtonClass=function(e){return e.Selected?"selected-button":null},e.prototype.buttonSelectClick=function(e){this.field.IsMultiChoiche?(e.Selected=!e.Selected,this.updateSelected(!1)):this.record[this.field.Name]=e.Value,this.onRecordValueChange()},e.prototype.updateSelected=function(e){void 0===e&&(e=!0),this.record[this.field.Name]=this.arrayData.filter((function(e){return e.Selected})).map((function(e){return e.Value})),this.setFormControlValue(),e&&this.onRecordValueChange()},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.prototype.setArrayData=function(){var e=this;Object.keys(this.field.ValuePairs).forEach((function(t){var o;o=e.field.IsMultiChoiche&&e.record[e.field.Name]&&e.record[e.field.Name].length>0?!!e.record[e.field.Name].find((function(o){return o==e.field.ValuePairs[t]})):e.record[e.field.Name]===e.field.ValuePairs[t],e.arrayData.push({Key:t,Value:e.field.ValuePairs[t],Selected:o})}))},e.prototype.setFormControlValue=function(){this.field.FormFormGroup.controls[this.field.Name].setValue(this.record[this.field.Name])},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"list-value-field-template",template:'<eqp-select *ngIf="field.PresentationMode == ListPresentationEnum[\'Combo box\']" [arrayData]="arrayData"\n [arrayKeyProperty]="\'Value\'" [showCancelButton]="!field.Required" [arrayValueProperty]="\'Key\'"\n [formGroupInput]="field.FormFormGroup" [formControlNameInput]="field.Name" [placeholder]="field.Label"\n [includeFullObject]="false" [isRequired]="field.Required" [isDisabled]="field.FormFormGroup.disabled"\n [(ngModelInput)]="record[field.Name]" [isMultiSelect]="field.IsMultiChoiche"\n (ngModelInputChange)="onRecordValueChange()">\n</eqp-select>\n\n<div *ngIf="field.PresentationMode != ListPresentationEnum[\'Combo box\']" [formGroup]="field.FormFormGroup">\n\n <mat-label class="mr-3"> {{field.Label + (field.Required ? " *" : "")}} </mat-label>\n\n \x3c!-- VISUALIZZAZIONE A RADIO BUTTON (SENZA SELEZIONE MULTIPLA) --\x3e\n <mat-radio-group *ngIf="field.PresentationMode == ListPresentationEnum[\'Radio button\'] && !field.IsMultiChoiche"\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\n <mat-radio-button class="mr-2" *ngFor="let data of arrayData" [value]="data.Value" color="primary">\n {{data.Key}}\n </mat-radio-button>\n </mat-radio-group>\n\n \x3c!-- VISUALIZZAZIONE A CHECKBOX (SELEZIONE MULTIPLA) --\x3e\n <div class="d-inline-block"\n *ngIf="field.PresentationMode == ListPresentationEnum[\'Radio button\'] && field.IsMultiChoiche">\n <mat-checkbox class="mr-2" *ngFor="let data of arrayData" [disabled]="field.FormFormGroup.disabled"\n [formControlName]="field.Name" [(ngModel)]="data.Selected" (ngModelChange)="updateSelected()">\n {{data.Key}}\n </mat-checkbox>\n </div>\n\n \x3c!-- VISUALIZZAZIONE A PULSANTI (CON TESTO) --\x3e\n <div class="d-inline-block" *ngIf="field.PresentationMode == ListPresentationEnum[\'Pulsante con testo\']">\n <button mat-raised-button color="primary" class="btn btn-primary mr-2" *ngFor="let data of arrayData"\n (click)="buttonSelectClick(data)" [ngClass]="getSelectButtonClass(data)"\n [disabled]="field.FormFormGroup.disabled">\n {{data.Key}}\n </button>\n </div>\n\n \x3c!-- TODO: VISUALIZZAZIONE A PULSANTI (CON IMMAGINI) ?? --\x3e\n</div>',styles:[".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}"]})],e)}(),AttachmentFieldTemplateComponent=function(){function e(e,t){this.utilityService=e,this.cdr=t,this.onlyImages=!1,this.recordChange=new core.EventEmitter,this.metadataFormGroups=new Array,this.previewLabel="Anteprima",this.emptyTableMessage="No record found",this.downloadTooltipPosition="below",this.openLinkLabel="Apri link",this.addButtonLabel="Aggiungi",this.downloadLabel="Download",this.deleteLabel="Elimina",this.fileNameLabel="Nome file",this.uploadFileLabel="Carica file",this.confirmLabel="Conferma",this.abortLabel="Annulla",this.saveLabel="Salva",this.exitLabel="Esci",this.eqpTableSearchText="Cerca...",this.deleteDialogTitle="Attenzione:",this.deleteDialogMessage="Sicuro di voler eliminare questo allegato?",this.noImageSelectedErrorMessage="Nessuna immagine selezionata!"}return e.prototype.ngOnInit=function(){this.setFormControlValue(),this.createMetadataFormGroups(),this.field.MetadataFields&&this.field.MetadataFields.sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0})),this.field.AllowedExtensions||(this.field.AllowedExtensions=AvailableFileExtensions.concat(AvailableImageExtensions).map((function(e){return e.key})))},e.prototype.ngAfterViewInit=function(){this.field.IsMultiAttach&&this.configureMultiAttachmentColumns()},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.catchAttachmentList=function(e){this.record[this.field.Name]=e,this.createMetadataFormGroups(),this.setFormControlValue(),this.onRecordValueChange(),this.cdr.detectChanges()},e.prototype.updateMetadataValidity=function(){this.metadataFormGroups.find((function(e){return e.invalid}))?this.field.FormFormGroup.controls[this.field.Name].setErrors({incorrect:!0}):this.field.FormFormGroup.controls[this.field.Name].setErrors(null),this.onRecordValueChange()},e.prototype.getFieldFromMetadata=function(e,t){var o=JSON.parse(JSON.stringify(this.field.MetadataFields.find((function(t){return t.Name===e.key}))));return o.FormFormGroup=this.metadataFormGroups[this.record[this.field.Name].indexOf(t)],o},e.prototype.setFormControlValue=function(){this.field.FormFormGroup.controls[this.field.Name].setValue(this.record[this.field.Name])},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.prototype.configureMultiAttachmentColumns=function(){var e=this;this.eqpAttachments&&this.eqpAttachments.attachmentsColumns&&this.field.MetadataFields&&this.field.MetadataFields.length>0&&this.field.MetadataFields.forEach((function(t){e.eqpAttachments.attachmentsColumns.splice(e.eqpAttachments.attachmentsColumns.length-1,0,{key:t.Name,display:t.Label,type:eqpTable.TypeColumn.ExternalTemplate,externalTemplate:e.metadataColumnTemplate})}))},e.prototype.createMetadataFormGroups=function(){var e=this;this.field.MetadataFields&&this.field.MetadataFields.length>0&&(this.metadataFormGroups=[],this.record[this.field.Name]&&this.record[this.field.Name].length>0&&this.record[this.field.Name].forEach((function(t){e.metadataFormGroups.push(e.utilityService.CreateFormFormGroup(e.field.MetadataFields,t,e.field.FormFormGroup.disabled,!e.field.IsMultiAttach))})),this.updateMetadataValidity())},e.ctorParameters=function(){return[{type:UtilityHelperService},{type:core.ChangeDetectorRef}]},__decorate([core.Input()],e.prototype,"onlyImages",void 0),__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),__decorate([core.ViewChild("eqpAttachments",{static:!0})],e.prototype,"eqpAttachments",void 0),__decorate([core.ViewChild("metadataColumnTemplate",{static:!0})],e.prototype,"metadataColumnTemplate",void 0),e=__decorate([core.Component({selector:"attachment-field-template",template:'<p *ngIf="!field.IsMultiAttach" class="mb-2">\n {{field.Label + (field.Required ? " *" : "")}}\n</p>\n<div class="row" *ngIf="!field.IsMultiAttach && record[field.Name] && record[field.Name][0]">\n <div class="mt-2" *ngFor="let metadata of field.MetadataFields" [ngClass]="utilityService.getFieldSyleClass(metadata)">\n <dynamic-module-field [field]="metadata" [record]="record[field.Name][0]"\n (recordChange)="updateMetadataValidity()">\n </dynamic-module-field>\n </div>\n</div>\n\n\n\n<eqp-attachments [attachmentsList]="record[field.Name]" [showMatCard]="true" [allowOnlyImages]="onlyImages"\n [isDisabled]="field.FormFormGroup.disabled" [showInlinePreview]="true" [multipleAttachment]="field.IsMultiAttach"\n [disableAction]="field.FormFormGroup.disabled" [acceptedFileTypes]="field.AllowedExtensions" [showHeader]="true"\n [headerTitle]="field.Label + (field.Required ? \' *\' : \'\')" [previewLabel]="previewLabel"\n [emptyTableMessage]="emptyTableMessage" [downloadTooltipPosition]="downloadTooltipPosition"\n [openLinkLabel]="openLinkLabel" [addButtonLabel]="addButtonLabel" [downloadLabel]="downloadLabel"\n [deleteLabel]="deleteLabel" [fileNameLabel]="fileNameLabel" [uploadFileLabel]="uploadFileLabel"\n [confirmLabel]="confirmLabel" [abortLabel]="abortLabel" [saveLabel]="saveLabel" [exitLabel]="exitLabel"\n [eqpTableSearchText]="eqpTableSearchText" [deleteDialogTitle]="deleteDialogTitle"\n [deleteDialogMessage]="deleteDialogMessage" [noImageSelectedErrorMessage]="noImageSelectedErrorMessage"\n (localEditedAttachments)="catchAttachmentList($event)" #eqpAttachments>\n</eqp-attachments>\n\n\x3c!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS --\x3e\n<ng-template #metadataColumnTemplate let-row="row" let-col="col">\n <dynamic-module-field [field]="getFieldFromMetadata(col, row)" [record]="row"\n (recordChange)="updateMetadataValidity()">\n </dynamic-module-field>\n</ng-template>',styles:[""]})],e)}(),ImageFieldTemplateComponent=function(){function e(){this.recordChange=new core.EventEmitter}return e.prototype.ngOnInit=function(){this.field.AttachDefinition.FormFormGroup=this.field.FormFormGroup,this.field.AttachDefinition.AllowedExtensions||(this.field.AttachDefinition.AllowedExtensions=AvailableImageExtensions.map((function(e){return e.key}))),this.field.AttachDefinition.Name=this.field.Name,this.field.AttachDefinition.Label=this.field.Label,this.field.AttachDefinition.Description=this.field.Description,this.field.AttachDefinition.Required=this.field.Required,this.field.AttachDefinition.Formula=this.field.Formula,this.field.AttachDefinition.FieldValue=this.field.FieldValue},e.prototype.ngOnChanges=function(e){null!=e.record&&0==e.record.firstChange&&JSON.stringify(e.record.currentValue)!=JSON.stringify(e.record.previousValue)&&(this.record=e.record.currentValue,this.updateField())},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),e=__decorate([core.Component({selector:"image-field-template",template:'<attachment-field-template [(record)]="record" [field]="field.AttachDefinition"\n [onlyImages]="true">\n</attachment-field-template>',styles:[""]})],e)}(),ListFormRecordComponent=function(){function ListFormRecordComponent(){this.showTitle=!0,this.columns=new Array,this.onAddViewEditRecord=new core.EventEmitter,this.onDeleteRecord=new core.EventEmitter,this.onDuplicateRecord=new core.EventEmitter}return ListFormRecordComponent.prototype.ngOnInit=function(){this.configureColumns()},ListFormRecordComponent.prototype.ngOnChanges=function(e){null!=e.values&&0==e.values.firstChange&&(this.values=e.values.currentValue,this.reloadTables())},ListFormRecordComponent.prototype.configureColumns=function(){var e=this;this.columns=[{key:"action",display:"",type:eqpTable.TypeColumn.MenuAction,buttonMenuIcon:"more_vert",styles:{flex:"0 0 6%"},actions:[{name:"Visualizza",icon:"info",fn:function(t,o,i){return e.viewOrEditRecord(t,!0)}},{name:"Modifica",icon:"edit",fn:function(t,o,i){return e.viewOrEditRecord(t,!1)}},{name:"Duplica",icon:"file_copy",fn:function(t,o,i){return e.duplicateRecord(t)}},{name:"Elimina",icon:"delete",fn:function(t,o,i){return e.deleteRecord(t)}}]}],this.createAdditionalActions(),this.createColumnsFromFormFields()},ListFormRecordComponent.prototype.createAdditionalActions=function(){var _this=this;this.form.ActionsOnRecord&&this.form.ActionsOnRecord.length>0&&this.form.ActionsOnRecord.sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0})).forEach((function(action){_this.columns.find((function(e){return"action"===e.key})).actions.push({name:action.Name,icon:action.Icon,fn:function(element,index,col){var rec=element,ctx=UtilityHelperService.context;eval(action.Action)}})}))},ListFormRecordComponent.prototype.viewOrEditRecord=function(e,t){this.onAddViewEditRecord.emit({record:e,onlyView:t})},ListFormRecordComponent.prototype.duplicateRecord=function(e){this.onDuplicateRecord.emit(e)},ListFormRecordComponent.prototype.deleteRecord=function(e){this.onDeleteRecord.emit(e)},ListFormRecordComponent.prototype.createColumnsFromFormFields=function(){var e=this;(this.form.Fields.find((function(e){return e.InListView}))?this.form.Fields.filter((function(e){return e.InListView})):this.form.Fields.filter((function(e){return e.OrdinalPosition<6}))).sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0})).forEach((function(t){e.columns.push(e.createFieldColumn(t))}))},ListFormRecordComponent.prototype.createFieldColumn=function(e){var t={key:e.Name,display:e.Label};switch(e.FieldType){case exports.FieldTypeEnum.Booleano:t.type=eqpTable.TypeColumn.Boolean,t.booleanValues={false:'<i class="fa fa-times error-color"></i>',true:'<i class="fa fa-check success-color"></i>'},t.styles={flex:"0 0 7%",cellAlignment:eqpTable.CellAlignmentEnum.CENTER};break;case exports.FieldTypeEnum["Data e/o ora"]:e.IsOnlyDate!=exports.DateTimeTypeEnum["Solo orario"]&&(t.type=eqpTable.TypeColumn.Date,e.IsOnlyDate==exports.DateTimeTypeEnum["Data e ora"]?t.format="dd/MM/yyyy HH:mm":e.IsOnlyDate==exports.DateTimeTypeEnum["Solo data"]&&(t.format="dd/MM/yyyy"));break;case exports.FieldTypeEnum["Campo numerico"]:e.CurrencySymbol?(t.numberPipe=eqpTable.NumberColumnPipe.CURRENCY,t.currencyPipeCode=e.CurrencySymbol):e.IsInteger||(t.numberPipe=eqpTable.NumberColumnPipe.DECIMAL);break;case exports.FieldTypeEnum.Allegato:case exports.FieldTypeEnum.Immagine:t.value=function(t){return e.IsMultiAttach||e.AttachDefinition&&e.AttachDefinition.IsMultiAttach?null!=t[e.Name]&&t[e.Name].length>0?t[e.Name].map((function(e){return e.FileName})).join(", "):null:null!=t[e.Name]&&t[e.Name].length>0?t[e.Name][0].FileName:null},t.isSortable=!1,t.isSearchable=!1;break;case exports.FieldTypeEnum["Elenco generico"]:t.value=function(t){return e.IsMultiChoiche?t[e.Name]&&0!=t[e.Name].length?Object.keys(e.ValuePairs).filter((function(o){return t[e.Name].includes(e.ValuePairs[o])})).join(", "):null:Object.keys(e.ValuePairs).find((function(o){return e.ValuePairs[o]==t[e.Name]}))},t.isSortable=!1,t.isSearchable=!1;break;case exports.FieldTypeEnum.Lookup:}return t},ListFormRecordComponent.prototype.reloadTables=function(){this.tableRecords&&this.tableRecords.reloadDatatable()},__decorate([core.Input()],ListFormRecordComponent.prototype,"showTitle",void 0),__decorate([core.Input()],ListFormRecordComponent.prototype,"form",void 0),__decorate([core.Input()],ListFormRecordComponent.prototype,"values",void 0),__decorate([core.ViewChild("tableRecords",{static:!0})],ListFormRecordComponent.prototype,"tableRecords",void 0),__decorate([core.Output()],ListFormRecordComponent.prototype,"onAddViewEditRecord",void 0),__decorate([core.Output()],ListFormRecordComponent.prototype,"onDeleteRecord",void 0),__decorate([core.Output()],ListFormRecordComponent.prototype,"onDuplicateRecord",void 0),ListFormRecordComponent=__decorate([core.Component({selector:"list-form-record",template:'<div class="row eqp-dynamic-module-title">\r\n <div class="col-md-6">\r\n <h4 *ngIf="showTitle"><b>Elenco {{form.Name}}</b></h4>\r\n </div>\r\n <div class="col-md-6 text-right">\r\n <button class="btn btn-primary" mat-raised-button color="primary" type="button" (click)="onAddViewEditRecord.emit(null)">\r\n <mat-icon>add</mat-icon>\r\n <span style="margin-left: 10px;">Aggiungi</span>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n\r\n<eqp-table #tableRecords [data]="values" [columns]="columns"></eqp-table>',styles:["::ng-deep .error-color{color:var(--danger)}::ng-deep .success-color{color:var(--success)}"]})],ListFormRecordComponent),ListFormRecordComponent}(),Record=function(){},AddFormRecordComponent=function(){function e(e,t){this.cdr=e,this.utilityService=t,this.showTitle=!0,this.showButtons=!0,this.form=new Form,this.fieldGroups={},this.FormScalarTypeEnum=exports.FormScalarTypeEnum,this.FieldTypeEnum=exports.FieldTypeEnum,this.saveRecordEvent=new core.EventEmitter}return e.prototype.ngOnInit=function(){null==this.record&&(this.record=new Record),this.createRecordProperties(),this.reorderFormFields(),this.createFormGroup(),this.form.FormScalarType!=exports.FormScalarTypeEnum.Semplice&&this.createFieldGroups(),this.cdr.detectChanges()},e.prototype.onRecordChange=function(){this.fieldTemplate&&this.fieldTemplate.length>0&&this.fieldTemplate.forEach((function(e){return e.updateField()}))},e.prototype.saveOrExitForm=function(e){e?this.saveRecordEvent.emit(null):this.saveRecordEvent.emit(this.record)},e.prototype.createRecordProperties=function(){var e=this,t=Object.keys(this.record);this.form.Fields.forEach((function(o){t.find((function(e){return e===o.Name}))||(e.record[o.Name]=null)})),this.form.InnerForms&&this.form.InnerForms.length>0&&this.form.InnerForms.forEach((function(o){var i=o.Name.split(" ").join("_");t.find((function(e){return e===i}))||(e.record[i]=[])}))},e.prototype.reorderFormFields=function(){this.form.Fields&&this.form.Fields.length>0&&this.form.Fields.sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0}))},e.prototype.createFormGroup=function(){this.formForm=this.utilityService.CreateFormFormGroup(this.form.Fields,this.record,this.onlyView)},e.prototype.createFieldGroups=function(){var e=this;this.form.FormFieldsGroups.sort((function(e,t){return e.OrdinalPosition>t.OrdinalPosition?1:t.OrdinalPosition>e.OrdinalPosition?-1:0})).map((function(e){return e.Name})).forEach((function(t){e.fieldGroups[t]=e.form.Fields.filter((function(e){return e.FieldGroup==t}))}))},e.ctorParameters=function(){return[{type:core.ChangeDetectorRef},{type:UtilityHelperService}]},__decorate([core.Input()],e.prototype,"showTitle",void 0),__decorate([core.Input()],e.prototype,"showButtons",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Input()],e.prototype,"onlyView",void 0),__decorate([core.Output()],e.prototype,"saveRecordEvent",void 0),__decorate([core.ViewChildren("fieldTemplate")],e.prototype,"fieldTemplate",void 0),e=__decorate([core.Component({selector:"add-form-record",template:'<div class="row eqp-dynamic-module-title" *ngIf="showTitle">\n <div class="col-md-12">\n <h4><b>{{form.Name}}</b></h4>\n </div>\n</div>\n\n<form [formGroup]="formForm">\n\n \x3c!-- VISUALIZZAZIONE SEMPLICE --\x3e\n <ng-container *ngIf="form.FormScalarType == FormScalarTypeEnum.Semplice" [ngTemplateOutlet]="fieldTemplates"\n [ngTemplateOutletContext]="{ fields: form.Fields }">\n </ng-container>\n\n \x3c!-- VISUALIZZAZIONE A STEPPER --\x3e\n <mat-horizontal-stepper linear *ngIf="form.FormScalarType == FormScalarTypeEnum[\'A step\']">\n <mat-step *ngFor="let group of form.FormFieldsGroups">\n <ng-template matStepLabel>\n {{group.Name}}\n </ng-template>\n\n <ng-container [ngTemplateOutlet]="fieldTemplates"\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\n </ng-container>\n </mat-step>\n </mat-horizontal-stepper>\n\n \x3c!-- VISUALIZZAZIONE A TAB --\x3e\n <mat-tab-group *ngIf="form.FormScalarType == FormScalarTypeEnum[\'In tab\']">\n <mat-tab *ngFor="let group of form.FormFieldsGroups" [label]="group.Name">\n <div class="mt-3">\n <ng-container [ngTemplateOutlet]="fieldTemplates"\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\n </ng-container>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n \x3c!-- VISUALIZZAZIONE AD ACCORDION --\x3e\n <mat-accordion multi *ngIf="form.FormScalarType == FormScalarTypeEnum[\'In accordion\']">\n <mat-expansion-panel *ngFor="let group of form.FormFieldsGroups">\n <mat-expansion-panel-header>\n <mat-panel-title>\n {{group.Name}}\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <ng-container [ngTemplateOutlet]="fieldTemplates"\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\n </ng-container>\n </mat-expansion-panel>\n </mat-accordion>\n</form>\n\n<div class="row mt-2" *ngIf="showButtons">\n <div class="col-sm-12 text-right">\n <button class="mr-2" mat-raised-button (click)="saveOrExitForm(true)" type="button">\n Annulla\n </button>\n <button class="mr-2" mat-raised-button color="primary" (click)="saveOrExitForm(false)"\n [disabled]="formForm.invalid || formForm.disabled" type="button">\n Salva\n </button>\n </div>\n</div>\n\n\x3c!-- TEMPLATE PER LA VISUALIZZAZIONE DEI CAMPI DELLA FORM --\x3e\n<ng-template #fieldTemplates let-fields=\'fields\'>\n <div class="row">\n <div class="mt-2" *ngFor="let field of fields" [ngClass]="utilityService.getFieldSyleClass(field)">\n <dynamic-module-field #fieldTemplate [field]="field" [form]="form" [record]="record"\n (recordChange)="onRecordChange()"></dynamic-module-field>\n </div>\n </div>\n</ng-template>',styles:[""]})],e)}(),DynamicModuleFieldComponent=function(){function e(e){this.dialog=e,this.recordChange=new core.EventEmitter,this.FieldTypeEnum=exports.FieldTypeEnum,this.onlyViewInnerFormRecord=!1}return e.prototype.updateField=function(){this.fieldTemplate&&this.fieldTemplate.length>0&&this.fieldTemplate.forEach((function(e){return e.updateField()}))},e.prototype.ngOnInit=function(){},e.prototype.onRecordChange=function(){this.recordChange.emit(this.record)},e.prototype.getInnerFormFromField=function(e){return this.form.InnerForms&&this.form.InnerForms.find((function(t){return t.Name==e.Label}))?this.form.InnerForms.find((function(t){return t.Name==e.Label})):null},e.prototype.onAddViewEditInnerFormRecord=function(e,t){this.selectedInnerForm=this.getInnerFormFromField(t),null==e?(this.selectedInnerFormRecord=new Record,this.indexInnerFormRecord=null,this.onlyViewInnerFormRecord=!1):(this.selectedInnerFormRecord=JSON.parse(JSON.stringify(e.record)),this.indexInnerFormRecord=this.record[t.Name].indexOf(e),this.onlyViewInnerFormRecord=e.onlyView),this.dialogInnerFormRecordRef=this.dialog.open(this.dialogInnerFormRecord,{disableClose:!0,hasBackdrop:!0,width:"75%"})},e.prototype.onSaveInnerFormRecord=function(e){if(null!=e){var t=this.selectedInnerForm.Name.split(" ").join("_");null!=this.indexInnerFormRecord&&this.indexInnerFormRecord>=0?this.record[t][this.indexInnerFormRecord]=e:(this.record[t]||(this.record[t]=[]),this.record[t].push(e))}this.dialogInnerFormRecordRef.close(),this.listInnerFormRecords&&this.listInnerFormRecords.length>0&&this.listInnerFormRecords.forEach((function(e){e&&e.tableRecords&&e.tableRecords.reloadDatatable()}))},e.ctorParameters=function(){return[{type:dialog.MatDialog}]},__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),__decorate([core.ViewChild("dialogInnerFormRecord",{static:!0})],e.prototype,"dialogInnerFormRecord",void 0),__decorate([core.ViewChildren("fieldTemplate")],e.prototype,"fieldTemplate",void 0),__decorate([core.ViewChildren("listInnerFormRecords")],e.prototype,"listInnerFormRecords",void 0),e=__decorate([core.Component({selector:"dynamic-module-field",template:'<text-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Campo di testo\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</text-field-template>\n\n<textarea-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Area di testo\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</textarea-field-template>\n\n<boolean-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Booleano\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</boolean-field-template>\n\n<date-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Data e/o ora\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</date-field-template>\n\n<numeric-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Campo numerico\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</numeric-field-template>\n\n<list-value-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Elenco generico\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</list-value-field-template>\n\n<attachment-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Allegato\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</attachment-field-template>\n\n<image-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Immagine\']"\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\n</image-field-template>\n\n<list-form-record #listInnerFormRecords *ngIf="field.FieldType == FieldTypeEnum[\'Form di dettaglio\']"\n [form]="getInnerFormFromField(field)" [values]="record[field.Name]"\n (onAddViewEditRecord)="onAddViewEditInnerFormRecord($event, field)">\n</list-form-record>\n\n\x3c!-- DIALOG PER AGGIUNGERE/MODIFICARE/VISUALIZZARE UN RECORD IN UNA FORM DI DETTAGLIO --\x3e\n<ng-template #dialogInnerFormRecord>\n <add-form-record [form]="selectedInnerForm" [record]="selectedInnerFormRecord" [onlyView]="onlyViewInnerFormRecord"\n (saveRecordEvent)="onSaveInnerFormRecord($event)"></add-form-record>\n</ng-template>',styles:[""]})],e)}(),EqpDynamicModuleModule=function(){function e(){}return e=__decorate([core.NgModule({declarations:[EqpDynamicModuleComponent,EqpDynamicModuleConfiguratorComponent,AddFormFieldComponent,TextFieldTemplateComponent,BooleanFieldTemplateComponent,DateFieldTemplateComponent,TextareaFieldTemplateComponent,NumericFieldTemplateComponent,ListValueFieldTemplateComponent,AttachmentFieldTemplateComponent,ImageFieldTemplateComponent,ListFormRecordComponent,AddFormRecordComponent,DynamicModuleFieldComponent],imports:[platformBrowser.BrowserModule,MaterialModule,forms.FormsModule,common.CommonModule,forms.ReactiveFormsModule,eqpTable.EqpTableModule,eqpAttachments.EqpAttachmentsModule,eqpSelect.EqpSelectModule,eqpDatetimepicker.EqpDatetimepickerModule,eqpFilters.EqpFiltersModule,eqpNumeric.EqpNumericModule],exports:[EqpDynamicModuleComponent,EqpDynamicModuleConfiguratorComponent]})],e)}(),Entity=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseObj),ImageField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),LookupField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),NumericField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),TextareaField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),TextField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField);exports.ActionOnRecord=ActionOnRecord,exports.AddFormFieldComponent=AddFormFieldComponent,exports.AddFormRecordComponent=AddFormRecordComponent,exports.ArrayValidators=ArrayValidators,exports.AttachmentField=AttachmentField,exports.AttachmentFieldTemplateComponent=AttachmentFieldTemplateComponent,exports.AvailableFileExtensions=AvailableFileExtensions,exports.AvailableImageExtensions=AvailableImageExtensions,exports.BaseField=BaseField,exports.BaseObj=BaseObj,exports.BooleanField=BooleanField,exports.BooleanFieldTemplateComponent=BooleanFieldTemplateComponent,exports.Context=Context,exports.ContextUser=ContextUser,exports.DateField=DateField,exports.DateFieldTemplateComponent=DateFieldTemplateComponent,exports.DynamicModuleFieldComponent=DynamicModuleFieldComponent,exports.Entity=Entity,exports.EqpDynamicModuleComponent=EqpDynamicModuleComponent,exports.EqpDynamicModuleConfiguratorComponent=EqpDynamicModuleConfiguratorComponent,exports.EqpDynamicModuleDialogService=EqpDynamicModuleDialogService,exports.EqpDynamicModuleModule=EqpDynamicModuleModule,exports.Form=Form,exports.FormFieldGroup=FormFieldGroup,exports.ImageField=ImageField,exports.ImageFieldTemplateComponent=ImageFieldTemplateComponent,exports.ListFormRecordComponent=ListFormRecordComponent,exports.ListValueField=ListValueField,exports.ListValueFieldTemplateComponent=ListValueFieldTemplateComponent,exports.LookupField=LookupField,exports.NumericField=NumericField,exports.NumericFieldTemplateComponent=NumericFieldTemplateComponent,exports.Record=Record,exports.TextField=TextField,exports.TextFieldTemplateComponent=TextFieldTemplateComponent,exports.TextareaField=TextareaField,exports.TextareaFieldTemplateComponent=TextareaFieldTemplateComponent,exports.UtilityHelperService=UtilityHelperService,exports.ɵa=MaterialModule,Object.defineProperty(exports,"__esModule",{value:!0})}));
17
17
  //# sourceMappingURL=eqproject-eqp-dynamic-module.umd.min.js.map