@eqproject/eqp-dynamic-module 0.0.4 → 0.0.6
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.
- package/README.md +43 -24
- package/bundles/eqproject-eqp-dynamic-module.umd.js +871 -227
- package/bundles/eqproject-eqp-dynamic-module.umd.js.map +1 -1
- package/bundles/eqproject-eqp-dynamic-module.umd.min.js +2 -2
- package/bundles/eqproject-eqp-dynamic-module.umd.min.js.map +1 -1
- package/eqproject-eqp-dynamic-module.d.ts +2 -1
- package/eqproject-eqp-dynamic-module.metadata.json +1 -1
- package/esm2015/eqproject-eqp-dynamic-module.js +3 -2
- package/esm2015/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +198 -22
- package/esm2015/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +124 -9
- package/esm2015/lib/components/private/add-form-field/add-form-field.component.js +64 -12
- package/esm2015/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/date-field-template/date-field-template.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/image-field-template/image-field-template.component.js +2 -2
- package/esm2015/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +21 -24
- package/esm2015/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +10 -2
- package/esm2015/lib/components/private/field-templates/text-field-template/text-field-template.component.js +18 -2
- package/esm2015/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +2 -2
- package/esm2015/lib/components/private/form-records/add-form-record/add-form-record.component.js +2 -2
- package/esm2015/lib/components/private/form-records/list-form-record/list-form-record.component.js +2 -18
- package/esm2015/lib/components/private/spinner/spinner.component.js +23 -0
- package/esm2015/lib/eqp-dynamic-module.module.js +3 -3
- package/esm2015/lib/models/endPointConfiguration.model.js +23 -0
- package/esm2015/lib/models/fields/dateField.model.js +1 -1
- package/esm2015/lib/models/fields/listValueField.model.js +3 -1
- package/esm2015/lib/models/fields/numericField.model.js +1 -1
- package/esm2015/lib/models/fields/textField.model.js +10 -1
- package/esm2015/lib/models/form.model.js +1 -1
- package/esm2015/lib/models/record.model.js +6 -1
- package/esm2015/lib/services/eqp-dynamic-module-dialog.service.js +10 -1
- package/esm2015/lib/services/spinner.service.js +43 -0
- package/esm2015/lib/services/utilityHelper.services.js +180 -13
- package/esm2015/public-api.js +3 -1
- package/esm5/eqproject-eqp-dynamic-module.js +3 -2
- package/esm5/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.js +204 -22
- package/esm5/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.js +126 -8
- package/esm5/lib/components/private/add-form-field/add-form-field.component.js +64 -12
- package/esm5/lib/components/private/dynamic-module-field/dynamic-module-field.component.js +2 -2
- package/esm5/lib/components/private/field-templates/attachment-field-template/attachment-field-template.component.js +2 -2
- package/esm5/lib/components/private/field-templates/boolean-field-template/boolean-field-template.component.js +2 -2
- package/esm5/lib/components/private/field-templates/date-field-template/date-field-template.component.js +2 -2
- package/esm5/lib/components/private/field-templates/image-field-template/image-field-template.component.js +2 -2
- package/esm5/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.js +22 -24
- package/esm5/lib/components/private/field-templates/numeric-field-template/numeric-field-template.component.js +10 -2
- package/esm5/lib/components/private/field-templates/text-field-template/text-field-template.component.js +18 -2
- package/esm5/lib/components/private/field-templates/textarea-field-template/textarea-field-template.component.js +2 -2
- package/esm5/lib/components/private/form-records/add-form-record/add-form-record.component.js +2 -2
- package/esm5/lib/components/private/form-records/list-form-record/list-form-record.component.js +2 -18
- package/esm5/lib/components/private/spinner/spinner.component.js +24 -0
- package/esm5/lib/eqp-dynamic-module.module.js +3 -3
- package/esm5/lib/models/endPointConfiguration.model.js +33 -0
- package/esm5/lib/models/fields/dateField.model.js +1 -1
- package/esm5/lib/models/fields/listValueField.model.js +7 -1
- package/esm5/lib/models/fields/numericField.model.js +1 -1
- package/esm5/lib/models/fields/textField.model.js +10 -1
- package/esm5/lib/models/form.model.js +1 -1
- package/esm5/lib/models/record.model.js +8 -1
- package/esm5/lib/services/eqp-dynamic-module-dialog.service.js +11 -1
- package/esm5/lib/services/spinner.service.js +46 -0
- package/esm5/lib/services/utilityHelper.services.js +182 -11
- package/esm5/public-api.js +3 -1
- package/fesm2015/eqproject-eqp-dynamic-module.js +820 -214
- package/fesm2015/eqproject-eqp-dynamic-module.js.map +1 -1
- package/fesm5/eqproject-eqp-dynamic-module.js +864 -228
- package/fesm5/eqproject-eqp-dynamic-module.js.map +1 -1
- package/lib/components/exported/eqp-dynamic-module/eqp-dynamic-module.component.d.ts +78 -4
- package/lib/components/exported/eqp-dynamic-module-configurator/eqp-dynamic-module-configurator.component.d.ts +51 -2
- package/lib/components/private/add-form-field/add-form-field.component.d.ts +29 -4
- package/lib/components/private/field-templates/list-value-field-template/list-value-field-template.component.d.ts +3 -11
- package/lib/components/private/field-templates/text-field-template/text-field-template.component.d.ts +3 -1
- package/lib/components/private/spinner/spinner.component.d.ts +9 -0
- package/lib/models/endPointConfiguration.model.d.ts +35 -0
- package/lib/models/fields/dateField.model.d.ts +1 -0
- package/lib/models/fields/listValueField.model.d.ts +17 -0
- package/lib/models/fields/numericField.model.d.ts +3 -1
- package/lib/models/fields/textField.model.d.ts +9 -1
- package/lib/models/form.model.d.ts +1 -0
- package/lib/models/record.model.d.ts +8 -0
- package/lib/services/eqp-dynamic-module-dialog.service.d.ts +6 -0
- package/lib/services/spinner.service.d.ts +15 -0
- package/lib/services/utilityHelper.services.d.ts +30 -1
- package/package.json +3 -3
- package/public-api.d.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("@angular/material/checkbox"),require("@angular/material/button"),require("@angular/material/input"),require("@angular/material/autocomplete"),require("@angular/material/datepicker"),require("@angular/material/form-field"),require("@angular/material/radio"),require("@angular/material/select"),require("@angular/material/slider"),require("@angular/material/slide-toggle"),require("@angular/material/menu"),require("@angular/material/sidenav"),require("@angular/material/toolbar"),require("@angular/material/list"),require("@angular/material/grid-list"),require("@angular/material/card"),require("@angular/material/stepper"),require("@angular/material/tabs"),require("@angular/material/expansion"),require("@angular/material/button-toggle"),require("@angular/material/chips"),require("@angular/material/icon"),require("@angular/material/progress-spinner"),require("@angular/material/progress-bar"),require("@angular/material/dialog"),require("@angular/material/tooltip"),require("@angular/material/snack-bar"),require("@angular/material/table"),require("@angular/material/sort"),require("@angular/material/paginator"),require("@angular/material/core"),require("@eqproject/eqp-table"),require("@eqproject/eqp-attachments"),require("@eqproject/eqp-select"),require("@eqproject/eqp-datetimepicker"),require("@eqproject/eqp-img-drawing"),require("@eqproject/eqp-filters"),require("@eqproject/eqp-numeric")
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("sweetalert2"),require("@angular/common/http"),require("rxjs"),require("@angular/material/checkbox"),require("@angular/material/button"),require("@angular/material/input"),require("@angular/material/autocomplete"),require("@angular/material/datepicker"),require("@angular/material/form-field"),require("@angular/material/radio"),require("@angular/material/select"),require("@angular/material/slider"),require("@angular/material/slide-toggle"),require("@angular/material/menu"),require("@angular/material/sidenav"),require("@angular/material/toolbar"),require("@angular/material/list"),require("@angular/material/grid-list"),require("@angular/material/card"),require("@angular/material/stepper"),require("@angular/material/tabs"),require("@angular/material/expansion"),require("@angular/material/button-toggle"),require("@angular/material/chips"),require("@angular/material/icon"),require("@angular/material/progress-spinner"),require("@angular/material/progress-bar"),require("@angular/material/dialog"),require("@angular/material/tooltip"),require("@angular/material/snack-bar"),require("@angular/material/table"),require("@angular/material/sort"),require("@angular/material/paginator"),require("@angular/material/core"),require("@eqproject/eqp-table"),require("@eqproject/eqp-attachments"),require("@eqproject/eqp-select"),require("@eqproject/eqp-datetimepicker"),require("@eqproject/eqp-img-drawing"),require("@eqproject/eqp-filters"),require("@eqproject/eqp-numeric")):"function"==typeof define&&define.amd?define("@eqproject/eqp-dynamic-module",["exports","@angular/common","@angular/core","@angular/forms","sweetalert2","@angular/common/http","rxjs","@angular/material/checkbox","@angular/material/button","@angular/material/input","@angular/material/autocomplete","@angular/material/datepicker","@angular/material/form-field","@angular/material/radio","@angular/material/select","@angular/material/slider","@angular/material/slide-toggle","@angular/material/menu","@angular/material/sidenav","@angular/material/toolbar","@angular/material/list","@angular/material/grid-list","@angular/material/card","@angular/material/stepper","@angular/material/tabs","@angular/material/expansion","@angular/material/button-toggle","@angular/material/chips","@angular/material/icon","@angular/material/progress-spinner","@angular/material/progress-bar","@angular/material/dialog","@angular/material/tooltip","@angular/material/snack-bar","@angular/material/table","@angular/material/sort","@angular/material/paginator","@angular/material/core","@eqproject/eqp-table","@eqproject/eqp-attachments","@eqproject/eqp-select","@eqproject/eqp-datetimepicker","@eqproject/eqp-img-drawing","@eqproject/eqp-filters","@eqproject/eqp-numeric"],t):t(((e=e||self).eqproject=e.eqproject||{},e.eqproject["eqp-dynamic-module"]={}),e.ng.common,e.ng.core,e.ng.forms,e.Swal,e.ng.common.http,e.rxjs,e.ng.material.checkbox,e.ng.material.button,e.ng.material.input,e.ng.material.autocomplete,e.ng.material.datepicker,e.ng.material.formField,e.ng.material.radio,e.ng.material.select,e.ng.material.slider,e.ng.material.slideToggle,e.ng.material.menu,e.ng.material.sidenav,e.ng.material.toolbar,e.ng.material.list,e.ng.material.gridList,e.ng.material.card,e.ng.material.stepper,e.ng.material.tabs,e.ng.material.expansion,e.ng.material.buttonToggle,e.ng.material.chips,e.ng.material.icon,e.ng.material.progressSpinner,e.ng.material.progressBar,e.ng.material.dialog,e.ng.material.tooltip,e.ng.material.snackBar,e.ng.material.table,e.ng.material.sort,e.ng.material.paginator,e.ng.material.core,e.eqpTable,e.eqpAttachments,e.eqpSelect,e.eqpDatetimepicker,e.eqpImgDrawing,e.eqpFilters,e.eqpNumeric)}(this,(function(exports,common,core,forms,Swal,http,rxjs,checkbox,button,input,autocomplete,datepicker,formField,radio,select,slider,slideToggle,menu,sidenav,toolbar,list,gridList,card,stepper,tabs,expansion,buttonToggle,chips,icon,progressSpinner,progressBar,dialog,tooltip,snackBar,table,sort,paginator,core$1,eqpTable,eqpAttachments,eqpSelect,eqpDatetimepicker,eqpImgDrawing,eqpFilters,eqpNumeric){"use strict";Swal=Swal&&Object.prototype.hasOwnProperty.call(Swal,"default")?Swal.default:Swal;
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -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.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,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("EnableDrawing",new forms.FormControl(this.field.EnableDrawing)),this.fieldFormGroup.addControl("ImageIsContextualAttachment",new forms.FormControl(this.field.ImageIsContextualAttachment)),this.onImageIsContextualAttachmentChange(),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.InListView.disable()):(this.fieldFormGroup.controls.Formula.enable(),this.fieldFormGroup.controls.InListView.enable())},e.prototype.onImageIsContextualAttachmentChange=function(){this.field.ImgName=null,this.field.AttachDefinition.AllowedExtensions=[],this.field.AttachDefinition.IsMultiAttach=!1,this.field.ContextualAttachment=null,this.field.ImageIsContextualAttachment?(this.fieldFormGroup.removeControl("IsMultiAttach"),this.fieldFormGroup.removeControl("AllowedExtensions"),this.fieldFormGroup.addControl("ImgName",new forms.FormControl(this.field.ImgName,forms.Validators.required)),this.fieldFormGroup.addControl("ContextualAttachment",new forms.FormControl(this.field.ContextualAttachment,forms.Validators.required))):(this.fieldFormGroup.removeControl("ImgName"),this.fieldFormGroup.removeControl("ContextualAttachment"),this.fieldFormGroup.addControl("IsMultiAttach",new forms.FormControl(this.field.AttachDefinition.IsMultiAttach)),this.fieldFormGroup.addControl("AllowedExtensions",new forms.FormControl(this.field.AttachDefinition.AllowedExtensions)))},e.prototype.catchContextualAttachmentChange=function(e){e&&e.length>0?this.field.ContextualAttachment=e[0]:this.field.ContextualAttachment=null,this.fieldFormGroup.controls.ContextualAttachment.setValue(this.field.ContextualAttachment)},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 [disabled]="fieldFormGroup.controls[\'InListView\'].disabled">\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 <div class="col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.ImageIsContextualAttachment" formControlName="ImageIsContextualAttachment"\n color="primary" (ngModelChange)="onImageIsContextualAttachmentChange()">\n Immagine pre-caricata nel campo\n </mat-slide-toggle>\n </div>\n <div class="col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\n <mat-slide-toggle [(ngModel)]="field.EnableDrawing" formControlName="EnableDrawing" color="primary">\n Abilita il disegno\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 *ngIf="!field.ImageIsContextualAttachment">\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" *ngIf="!field.ImageIsContextualAttachment">\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 col-md-4 mt-2" [formGroup]="fieldFormGroup" *ngIf="field.ImageIsContextualAttachment">\n <mat-form-field>\n <mat-label> Nome immagine </mat-label>\n <input formControlName="ImgName" matInput [(ngModel)]="field.ImgName" required>\n </mat-form-field>\n </div>\n <div class="col-sm-12 col-md-8 mt-2" [formGroup]="fieldFormGroup" *ngIf="field.ImageIsContextualAttachment">\n <eqp-attachments [attachmentsList]="field._contextualAttachments" [showMatCard]="false" [allowOnlyImages]="true"\n [isDisabled]="false" [showInlinePreview]="true" [multipleAttachment]="false" [showHeader]="false"\n (localEditedAttachments)="catchContextualAttachmentChange($event)" #contextualAttachmentEqpAttachments>\n </eqp-attachments>\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.onAttachmentsChange=new core.EventEmitter,this.metadataFormGroups=new Array}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.onAttachmentsChange.emit(),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.Output()],e.prototype,"onAttachmentsChange",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"\n [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<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 ? \' *\' : \'\')" (localEditedAttachments)="catchAttachmentList($event)"\n #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)}(),toBase64=function(e){return new Promise((function(t,o){var i=new FileReader;i.readAsDataURL(e),i.onload=function(){return t(i.result.toString())},i.onerror=function(e){return o(e)}}))},ɵ0=toBase64,ImageFieldTemplateComponent=function(){function e(e,t){this.dialog=e,this.utilityService=t,this.recordChange=new core.EventEmitter,this.width=null,this.height=null,this.i18n={saveBtn:"Salva modifiche",cancelBtn:"Ricarica originale"}}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,this.field.ImageIsContextualAttachment&&this.field.ContextualAttachment&&(this.record[this.field.Name]&&Array.isArray(this.record[this.field.Name])&&this.record[this.field.Name].length>0||(this.record[this.field.Name]=[JSON.parse(JSON.stringify(this.field.ContextualAttachment))]),this.preLoadedImageMetadataFormGroup=this.utilityService.CreateFormFormGroup(this.field.AttachDefinition.MetadataFields,this.record[this.field.Name][0]),this.getImageDimensions())},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.updateMetadataValidity=function(){this.preLoadedImageMetadataFormGroup.invalid?this.field.FormFormGroup.controls[this.field.Name].setErrors({incorrect:!0}):this.field.FormFormGroup.controls[this.field.Name].setErrors(null),this.onRecordValueChange()},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.resetPreLoadedImage=function(){this.width=null,this.height=null,this.record[this.field.Name]=[JSON.parse(JSON.stringify(this.field.ContextualAttachment))],this.getImageDimensions()},e.prototype.onAttachmentsChange=function(){!this.field.AttachDefinition.IsMultiAttach&&this.field.EnableDrawing&&this.record[this.field.Name]&&this.record[this.field.Name][0]&&(this.getImageDimensions(),this.dialogImageDrowingRef=this.dialog.open(this.dialogImageDrowing,{disableClose:!0,hasBackdrop:!0,width:"75%"}))},e.prototype.saveDrowning=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){switch(o.label){case 0:return[4,toBase64(e)];case 1:return(t=o.sent())&&(this.record[this.field.Name][0].FileContentType=t.split(",")[0].split(":")[1].split(";")[0],this.record[this.field.Name][0].FileDataBase64=t.split(",")[1]),this.dialogImageDrowingRef&&this.closeImageDrowingDialog(),[2]}}))}))},e.prototype.closeImageDrowingDialog=function(){this.dialogImageDrowingRef.close(),this.width=null,this.height=null},e.prototype.getImageDimensions=function(){var e=this,t=this.getBlobFromBase64(),o=new FileReader;o.onload=function(t){var o=new Image;o.src=t.target.result,o.onload=function(t){e.height=t.currentTarget.height,e.width=t.currentTarget.width}},o.readAsDataURL(t)},e.prototype.getBlobFromBase64=function(){for(var e=atob(this.record[this.field.Name][0].FileDataBase64),t=new Array(e.length),o=0;o<e.length;o++)t[o]=e.charCodeAt(o);var i=new Uint8Array(t);return new Blob([i],{type:this.record[this.field.Name][0].FileContentType})},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.ctorParameters=function(){return[{type:dialog.MatDialog},{type:UtilityHelperService}]},__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),__decorate([core.ViewChild("dialogImageDrowing",{static:!0})],e.prototype,"dialogImageDrowing",void 0),e=__decorate([core.Component({selector:"image-field-template",template:'\x3c!-- VISUALIZZAZIONE ALLEGATO PRE CARICATO CON POSSIBILITA\' DI DISEGNO --\x3e\n<div class="row" *ngIf="field.ImageIsContextualAttachment && field.ContextualAttachment">\n <div class="col-sm-12 col-md-6 col-lg-4">\n <p class="mb-2">\n {{ field.Label + (field.Required ? " *" : "")}}\n <br>\n Nome immagine: {{ field.ImgName}}\n </p>\n <eqp-img-drawing\n *ngIf="field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null"\n [src]="\'data:\'+ record[field.Name][0].FileContentType + \';base64,\'+ record[field.Name][0].FileDataBase64"\n [showCancelButton]="false" [enableLoadAnotherImage]="false" [enableRemoveImage]="false" [width]="width"\n [height]="height" [i18n]="i18n" [showCancelButton]="true" (save)="saveDrowning($event)"\n (cancel)="resetPreLoadedImage()">\n </eqp-img-drawing>\n\n <img *ngIf="!field.EnableDrawing"\n [src]="\'data:\'+ record[field.Name][0].FileContentType+ \';base64,\'+ record[field.Name][0].FileDataBase64">\n </div>\n\n <div class="col-sm-12 col-md-6 col-lg-8">\n <div class="row"\n *ngIf="field.AttachDefinition && field.AttachDefinition.MetadataFields && preLoadedImageMetadataFormGroup">\n <div class="mt-2" *ngFor="let metadata of field.AttachDefinition.MetadataFields"\n [ngClass]="utilityService.getFieldSyleClass(metadata)">\n <dynamic-module-field #fieldTemplate [field]="metadata" [form]="preLoadedImageMetadataFormGroup"\n [record]="record[field.Name][0]" (recordChange)="updateMetadataValidity()">\n </dynamic-module-field>\n </div>\n </div>\n </div>\n</div>\n\n\x3c!-- COMPONENTE IN CUI CARICARE NUOVI ALLEGATI --\x3e\n<attachment-field-template [(record)]="record" [field]="field.AttachDefinition" [onlyImages]="true"\n (onAttachmentsChange)="onAttachmentsChange()" *ngIf="!field.ImageIsContextualAttachment">\n</attachment-field-template>\n\n\x3c!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO --\x3e\n<ng-template #dialogImageDrowing>\n <div *ngIf="field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null"\n class="row">\n <div class="col-sm-12 col-md-12">\n <eqp-img-drawing [showCancelButton]="false" [enableLoadAnotherImage]="false" [enableRemoveImage]="false"\n [src]="\'data:\'+ record[field.Name][0].FileContentType + \';base64,\'+ record[field.Name][0].FileDataBase64"\n [i18n]="i18n" [showCancelButton]="false" (save)="saveDrowning($event)">\n </eqp-img-drawing>\n </div>\n </div>\n <div class="row mt-2 mb-1">\n <div class="col-sm-12 text-right">\n <button class="btn mat-raised-button" (click)="closeImageDrowingDialog()" type="button">\n Annulla disegno\n </button>\n </div>\n </div>\n</ng-template>',styles:["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]})],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,eqpImgDrawing.EqpImgDrawingModule],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),Object.defineProperty(t.prototype,"_contextualAttachments",{get:function(){return this.ContextualAttachment?[this.ContextualAttachment]:[]},enumerable:!0,configurable:!0}),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.ɵ0=ɵ0,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 r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function __extends(e,t){function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function __rest(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}function __decorate(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var l=e.length-1;l>=0;l--)(n=e[l])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function __param(e,t){return function(r,o){t(r,o,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function l(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,l)}d((o=o.apply(e,t||[])).next())}))}function __generator(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}function __createBinding(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}function __exportStar(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],o=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a}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,r=arguments.length;t<r;t++)e+=arguments[t].length;var o=Array(e),n=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,l=i.length;a<l;a++,n++)o[n]=i[a];return o}function __await(e){return this instanceof __await?(this.v=e,this):new __await(e)}function __asyncGenerator(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,n=r.apply(e,t||[]),i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(e){n[e]&&(o[e]=function(t){return new Promise((function(r,o){i.push([e,t,r,o])>1||l(e,t)}))})}function l(e,t){try{(r=n[e](t)).value instanceof __await?Promise.resolve(r.value.v).then(d,s):m(i[0][2],r)}catch(e){m(i[0][3],e)}var r}function d(e){l("next",e)}function s(e){l("throw",e)}function m(e,t){e(t),i.shift(),i.length&&l(i[0][0],i[0][1])}}function __asyncDelegator(e){var t,r;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,n){t[o]=e[o]?function(t){return(r=!r)?{value:__await(e[o](t)),done:"return"===o}:n?n(t):t}:n}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(r){t[r]=e[r]&&function(t){return new Promise((function(o,n){(function(e,t,r,o){Promise.resolve(o).then((function(t){e({value:t,done:r})}),t)})(o,n,(t=e[r](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 r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);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,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}var Context=function(){this.User=new ContextUser},ContextUser=function(){},EndPointConfiguration=function(){},EndPointData=function(){},EndPointDataParams=function(){this.ParamValue=null},ParamTypeEnum,RequestMethodEnum;ParamTypeEnum=exports.ParamTypeEnum||(exports.ParamTypeEnum={}),ParamTypeEnum[ParamTypeEnum["Query param"]=1]="Query param",ParamTypeEnum[ParamTypeEnum["In route"]=2]="In route",ParamTypeEnum[ParamTypeEnum["In Body"]=3]="In Body",RequestMethodEnum=exports.RequestMethodEnum||(exports.RequestMethodEnum={}),RequestMethodEnum.GET="GET",RequestMethodEnum.POST="POST",RequestMethodEnum.PUT="PUT",RequestMethodEnum.DELETE="DELETE";var 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 Record=function(){},DynRecord=function(){this.Values={}},EqpDynamicModuleDialogService=function(){function e(){}return e.Success=function(e,t){void 0===t&&(t=null);var r=null!=t?t:"Operazione completata con successo.";Swal.fire(r,e,"success")},e.Error=function(e,t){void 0===t&&(t=null);var r=null!=t?t:"Errore";if(Array.isArray(e)){r=null!=t?t:"Errore";var o=e.join("<br>");Swal.fire({title:r,html:o,icon:"error"})}else Swal.fire(r,e,"error")},e.Confirm=function(e,t,r,o,n){void 0===r&&(r=!1),void 0===o&&(o=null),void 0===n&&(n=null);var i=null!=o?o:"Sei sicuro di voler procedere?";if(Array.isArray(e)){var a=e.join("<br>");Swal.fire({title:i,html:a,width:n||"32rem",icon:r?"warning":"question",showCancelButton:!0,allowOutsideClick:!1,allowEscapeKey:!1}).then((function(e){e.value&&t&&t()}))}else Swal.fire({title:i,text:e,width:n||"32rem",icon:r?"warning":"question",showCancelButton:!0,allowOutsideClick:!1,allowEscapeKey:!1}).then((function(e){e.value&&t&&t()}))},e.Info=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);var o=null!=t?t:"Informazione:";Swal.fire(o,e,"info")},e.Warning=function(e,t,r){void 0===t&&(t=null),void 0===r&&(r=null);var o=null!=t?t:"Attenzione!";if(Array.isArray(e)){var n=e.join("<br>");Swal.fire({title:o,html:n,icon:"warning"})}else Swal.fire(o,e,"warning")},e.ɵprov=core.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=__decorate([core.Injectable({providedIn:"root"})],e)}(),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 TextField=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t}(BaseField),TextMaskEnum;TextMaskEnum=exports.TextMaskEnum||(exports.TextMaskEnum={}),TextMaskEnum[TextMaskEnum.Password=1]="Password",TextMaskEnum[TextMaskEnum.Email=2]="Email",TextMaskEnum[TextMaskEnum.Telefono=3]="Telefono",TextMaskEnum[TextMaskEnum.Url=4]="Url";var UrlRegex="(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?",TelRegex="([+]?[0-9]{10,14})",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}(),SpinnerService=function(){function e(){this.isLoading=new rxjs.Subject,this.requestsCount=0}return e.prototype.show=function(){var e=this;setTimeout((function(){e.isLoading.next(!0)}),100)},e.prototype.hide=function(){var e=this;setTimeout((function(){e.isLoading.next(!1)}),100)},e.prototype.addRequestCounter=function(){this.requestsCount++,this.show()},e.prototype.removeRequestCounter=function(){this.requestsCount--,0==this.requestsCount&&this.hide()},e.ɵprov=core.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=__decorate([core.Injectable({providedIn:"root"})],e)}(),UtilityHelperService=function(){function UtilityHelperService(e,t,r){this.formBuilder=e,this.http=t,this.spinnerService=r}var UtilityHelperService_1;return UtilityHelperService_1=UtilityHelperService,UtilityHelperService.EvaluateFieldFormula=function(formula,rec,ctx){var evaluatedValue=eval(formula);return evaluatedValue||null},UtilityHelperService.SetContext=function(e){this.context=e},UtilityHelperService.GetFieldType=function(e){switch(e.FieldType){case exports.FieldTypeEnum["Campo di testo"]:return Object.assign(new TextField,e)}},UtilityHelperService.GetAutocompleteOptions=function(e,t){var r=[],o=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)))r=[{label:"rec",value:(t||"")+"rec"},{label:"ctx",value:(t||"")+"ctx"}];else if(t.endsWith(".")){var n=t.split(" ")[t.split(" ").length-1].split(".");r="rec"===n[n.length-2]?o.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 i=[],a=t.split(" "),l=a[a.length-1];if(!new RegExp("[^0-9a-zA-Z_.]").test(l)){var d=l.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=o),m.forEach((function(e){e.startsWith(s)&&i.push({label:e,value:t+e.substring(s.length,e.length)})}))}r=i}return r},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,r,o){var n=this;void 0===r&&(r=!1),void 0===o&&(o=!0);var i=this.formBuilder.group([]);return e.forEach((function(e){i.addControl(e.Name,n.createFieldFormControl(e,t)),o&&(e.FormFormGroup=i)})),r&&i.disable(),i},UtilityHelperService.prototype.createFieldFormControl=function(e,t){var r=[];switch(e.Required&&r.push(forms.Validators.required),e.FieldType){case exports.FieldTypeEnum["Campo di testo"]:switch(e.MaxLenght&&r.push(forms.Validators.maxLength(e.MaxLenght)),e.MinLenght&&r.push(forms.Validators.minLength(e.MinLenght)),e.TextMask){case exports.TextMaskEnum.Url:r.push(forms.Validators.pattern(UrlRegex));break;case exports.TextMaskEnum.Email:r.push(forms.Validators.email);break;case exports.TextMaskEnum.Telefono:r.push(forms.Validators.pattern(TelRegex))}break;case exports.FieldTypeEnum["Area di testo"]:e.MaxLenght&&r.push(forms.Validators.maxLength(e.MaxLenght)),e.MinLenght&&r.push(forms.Validators.minLength(e.MinLenght));break;case exports.FieldTypeEnum.Allegato:case exports.FieldTypeEnum.Immagine:e.Required&&r.push(ArrayValidators.minLenght(1));break;case exports.FieldTypeEnum["Elenco generico"]:e.IsMultiChoiche&&e.Required&&r.push(ArrayValidators.minLenght(1))}return new forms.FormControl(t[e.Name],r)},UtilityHelperService.prototype.ConfigureDefaultEndPoints=function(e,t){var r=new EndPointConfiguration;return(r=new EndPointConfiguration).Records={GetByFormIDEndPoint:{Url:e+"/api/v1/getall",Token:t,RequestMethod:exports.RequestMethodEnum.GET},GetByIDEndPoint:{Url:e+"/api/v1/getByID",Token:t,RequestMethod:exports.RequestMethodEnum.GET},SaveEndPoint:{Url:e+"/api/v1/save",Token:t,RequestMethod:exports.RequestMethodEnum.POST},DuplicateEndPoint:{Url:e+"/api/v1/duplicate",Token:t,RequestMethod:exports.RequestMethodEnum.POST},DeleteEndPoint:{Url:e+"/api/v1/delete",Token:t,RequestMethod:exports.RequestMethodEnum.DELETE}},r.Forms={GetByIDEndPoint:{Url:e+"/api/conf/form",Token:t,RequestMethod:exports.RequestMethodEnum.GET},SaveEndPoint:{Url:e+"/api/conf/form",Token:t,RequestMethod:exports.RequestMethodEnum.POST}},r},UtilityHelperService.prototype.RunEndPointCall=function(e,t,r,o){var n=this;void 0===t&&(t=null),void 0===r&&(r=null),void 0===o&&(o=null),this.spinnerService.addRequestCounter();var i=""+e.Url,a=null,l={AdditionalParams:{}};e.Params&&e.Params.forEach((function(e){switch(e.ParamType){case exports.ParamTypeEnum["Query param"]:var t=e.ParamName+"="+e.ParamValue;a=(null==a?"":a+"&")+t;break;case exports.ParamTypeEnum["In route"]:i=i+(i.endsWith("/")?"":"/")+e.ParamValue;break;case exports.ParamTypeEnum["In Body"]:l.AdditionalParams[e.ParamName]=e.ParamValue}})),t&&t.forEach((function(e){switch(e.ParamType){case exports.ParamTypeEnum["Query param"]:var t=e.ParamName+"="+e.ParamValue;a=(null==a?"":a+"&")+t;break;case exports.ParamTypeEnum["In route"]:i=i+(i.endsWith("/")?"":"/")+e.ParamValue;break;case exports.ParamTypeEnum["In Body"]:l[e.ParamName]=e.ParamValue}})),null!=a&&(i=(i.endsWith("/")?i.substring(0,i.length-1):i)+"?"+a),this.http.request(e.RequestMethod,i,{headers:e.Token?{Authorization:e.Token}:null,body:[exports.RequestMethodEnum.DELETE,exports.RequestMethodEnum.GET].includes(e.RequestMethod)?null:l}).subscribe((function(e){n.spinnerService.removeRequestCounter(),r&&r(e)}),(function(e){throw n.spinnerService.removeRequestCounter(),o&&o(e),EqpDynamicModuleDialogService.Error(e.message),new Error(e.message)}))},UtilityHelperService.context=new Context,UtilityHelperService.ctorParameters=function(){return[{type:forms.FormBuilder},{type:http.HttpClient},{type:SpinnerService}]},UtilityHelperService.ɵprov=core.ɵɵdefineInjectable({factory:function(){return new UtilityHelperService(core.ɵɵinject(forms.FormBuilder),core.ɵɵinject(http.HttpClient),core.ɵɵinject(SpinnerService))},token:UtilityHelperService,providedIn:"root"}),UtilityHelperService=UtilityHelperService_1=__decorate([core.Injectable({providedIn:"root"})],UtilityHelperService),UtilityHelperService}(),EqpDynamicModuleComponent=function(){function e(e){this.utilityHelperService=e,this.context=new Context,this.showButtons=!0,this.showTitle=!0,this.baseServerUrl=null,this.userToken=null,this.endPointConfiguration=null,this.saveRecord=new core.EventEmitter,this.deleteRecord=new core.EventEmitter,this.duplicateRecord=new core.EventEmitter,this.afterSaveRecord=new core.EventEmitter,this.afterDeleteRecord=new core.EventEmitter,this.afterDuplicateRecord=new core.EventEmitter,this.form=new Form,this.viewMode=exports.FormTypeEnum.LIST,this.FormTypeEnum=exports.FormTypeEnum}return e.prototype.ngOnInit=function(){UtilityHelperService.SetContext(this.context),this.configureDefaultEndPoints(),this.getFormByID()},e.prototype.getFormByID=function(){var e=this,t=new Array;t.push({ParamName:"id",ParamValue:this.formID,ParamType:exports.ParamTypeEnum["Query param"]}),this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint,t,(function(t){e.form=t,e.getRecordsByFormID()}),(function(e){console.log(e)}))},e.prototype.configureDefaultEndPoints=function(){!this.endPointConfiguration&&this.baseServerUrl&&(this.endPointConfiguration=this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl,this.userToken))},e.prototype.getRecordsByFormID=function(){var e=this;if(this.endPointConfiguration&&this.endPointConfiguration.Records&&this.endPointConfiguration.Records.GetByFormIDEndPoint){var t=[{ParamName:"EntID",ParamValue:this.form.ID,ParamType:exports.ParamTypeEnum["Query param"]}];this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByFormIDEndPoint,t,(function(t){e.values=new Array,t.forEach((function(t){var r=new Record;(r=JSON.parse(t.SerializedValues)).ID=t.ID,r.EntID=t.EntID,e.values.push(r)}))}))}},e.prototype.onAddViewEditRecord=function(e){var t=this;if(null!=e)if(this.onlyView=e.onlyView,this.endPointConfiguration&&this.endPointConfiguration.Records&&this.endPointConfiguration.Records.GetByIDEndPoint){var r=[{ParamName:"id",ParamValue:e.record.ID,ParamType:exports.ParamTypeEnum["Query param"]}];this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.GetByIDEndPoint,r,(function(e){t.selectedRecord=JSON.parse(e.SerializedValues),t.selectedRecord.ID=e.ID,t.selectedRecord.EntID=e.EntID,t.viewMode=exports.FormTypeEnum.SCALAR}))}else this.selectedRecord=JSON.parse(JSON.stringify(e.record)),this.viewMode=exports.FormTypeEnum.SCALAR;else this.selectedRecord=null,this.onlyView=!1,this.viewMode=exports.FormTypeEnum.SCALAR},e.prototype.onSaveRecord=function(e){var t,r=this;if(null!=e&&null!=this.endPointConfiguration&&this.endPointConfiguration.Records.SaveEndPoint){var o=new DynRecord;o.ID=null!=(t=e.ID)?t:null,o.EntID=this.form.ID,o.Values=null!=e?e:null;var n=[{ParamName:"Record",ParamValue:o,ParamType:exports.ParamTypeEnum["In Body"]}];this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Records.SaveEndPoint,n,(function(t){r.getRecordsByFormID(),r.afterSaveRecord.emit(e),r.viewMode=exports.FormTypeEnum.LIST}))}else this.saveRecord.emit(e),this.viewMode=exports.FormTypeEnum.LIST},e.prototype.onDuplicateRecord=function(e){var t=this;this.endPointConfiguration&&this.endPointConfiguration.Records.DuplicateEndPoint?EqpDynamicModuleDialogService.Confirm("Duplicare il record selezionato?",(function(){var r=[{ParamName:"id",ParamValue:e.ID,ParamType:exports.ParamTypeEnum["Query param"]}];t.utilityHelperService.RunEndPointCall(t.endPointConfiguration.Records.DuplicateEndPoint,r,(function(r){t.getRecordsByFormID(),t.afterDuplicateRecord.emit(e)}))}),!1,"Richiesta conferma"):this.duplicateRecord.emit(e)},e.prototype.onDeleteRecord=function(e){var t=this;this.endPointConfiguration&&this.endPointConfiguration.Records.DeleteEndPoint?EqpDynamicModuleDialogService.Confirm("Eliminare il record selezionato?",(function(){var r=[{ParamName:"id",ParamValue:e.ID,ParamType:exports.ParamTypeEnum["Query param"]}];t.utilityHelperService.RunEndPointCall(t.endPointConfiguration.Records.DeleteEndPoint,r,(function(r){t.getRecordsByFormID(),t.afterDeleteRecord.emit(e)}))}),!1,"Richiesta conferma"):this.deleteRecord.emit(e)},e.ctorParameters=function(){return[{type:UtilityHelperService}]},__decorate([core.Input()],e.prototype,"context",void 0),__decorate([core.Input()],e.prototype,"formID",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,"baseServerUrl",void 0),__decorate([core.Input()],e.prototype,"userToken",void 0),__decorate([core.Input()],e.prototype,"endPointConfiguration",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),__decorate([core.Output()],e.prototype,"afterSaveRecord",void 0),__decorate([core.Output()],e.prototype,"afterDeleteRecord",void 0),__decorate([core.Output()],e.prototype,"afterDuplicateRecord",void 0),e=__decorate([core.Component({selector:"eqp-dynamic-module",template:'<eqp-dynamic-module-spinner></eqp-dynamic-module-spinner>\r\n\r\n<add-form-record *ngIf="viewMode == FormTypeEnum.SCALAR" [form]="form" [record]="selectedRecord"\r\n [showButtons]="showButtons" [onlyView]="onlyView" (saveRecordEvent)="onSaveRecord($event)" [showTitle]="showTitle">\r\n</add-form-record>\r\n\r\n<list-form-record *ngIf="viewMode == FormTypeEnum.LIST && values" [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)}(),EqpDynamicModuleConfiguratorComponent=function(){function e(e,t,r){this.formBuilder=e,this.dialog=t,this.utilityHelperService=r,this.context=new Context,this.form=new Form,this.formID=null,this.innerFormManagment=!1,this.baseServerUrl=null,this.userToken=null,this.endPointConfiguration=null,this.formCompleted=!1,this.FormTypeEnum=exports.FormTypeEnum,this.FormScalarTypeEnum=exports.FormScalarTypeEnum,this.saveFormEvent=new core.EventEmitter,this.afterSaveFormEvent=new core.EventEmitter}return e.prototype.ngOnInit=function(){this.configureDefaultEndPoints(),this.getFormByID(),this.context&&UtilityHelperService.SetContext(this.context)},e.prototype.configureDefaultEndPoints=function(){!this.endPointConfiguration&&this.baseServerUrl&&(this.endPointConfiguration=this.utilityHelperService.ConfigureDefaultEndPoints(this.baseServerUrl,this.userToken),this.formID&&(this.endPointConfiguration.Forms.GetByIDEndPoint.Params=[{ParamName:"id",ParamValue:this.formID,ParamType:exports.ParamTypeEnum["Query param"]}]))},e.prototype.getFormByID=function(){var e=this;this.formID&&this.endPointConfiguration&&this.endPointConfiguration.Forms&&this.endPointConfiguration.Forms.GetByIDEndPoint?this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.GetByIDEndPoint,null,(function(t){e.setFormAndConfigure(t)}),(function(t){e.setFormAndConfigure(new Form)})):this.setFormAndConfigure()},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(r,o){return r.Label===e.Label&&(null==t.indexSelectedField||t.indexSelectedField!==o)})))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(r,o){return r.Name===e.Name&&(null==t.indexSelectedInnerForm||t.indexSelectedInnerForm!==o)}))||this.form.Fields&&null==this.indexSelectedInnerForm&&this.form.Fields.find((function(r,o){return r.Label===e.Name&&(null==t.indexSelectedField||t.indexSelectedField!==o)})))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 r=new BaseField;r.Name=e.Name.split(" ").join("_"),r.Label=e.Name,r.FieldType=exports.FieldTypeEnum["Form di dettaglio"],r.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]=r):(this.form.InnerForms||(this.form.InnerForms=new Array),this.form.InnerForms.push(e),this.form.Fields.push(r)),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,r){return t.Name===e.selectedAction.Name&&(null==e.indexSelectedAction||e.indexSelectedAction!==r)})))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(){var e=this;if(null!=this.endPointConfiguration&&this.endPointConfiguration.Forms.SaveEndPoint){var t=JSON.parse(JSON.stringify(this.form));t.Fields=[],this.form.Fields.forEach((function(e){var r=UtilityHelperService.GetFieldType(e);t.Fields.push(r)}));var r=[{ParamName:"Form",ParamValue:t,ParamType:exports.ParamTypeEnum["In Body"]}];this.utilityHelperService.RunEndPointCall(this.endPointConfiguration.Forms.SaveEndPoint,r,(function(t){EqpDynamicModuleDialogService.Success("Form salvata con successo!"),e.afterSaveFormEvent.emit(e.form)}))}else this.saveFormEvent.emit(this.form)},e.prototype.setFormAndConfigure=function(e){void 0===e&&(e=null),null!=e&&(this.form=e),this.configureColumns(),this.createFormForm()},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,r,o){return e.editField(t)}},{name:"Elimina",icon:"delete",fn:function(t,r,o){return e.deleteElement(t,"Fields")}},{name:"Sposta su",icon:"arrow_upward",fn:function(t,r,o){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,r,o){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,r,o){return e.openActionOnRecordDialog(t)}},{name:"Elimina",icon:"delete",fn:function(t,r,o){return e.deleteElement(t,"ActionsOnRecord")}},{name:"Sposta su",icon:"arrow_upward",fn:function(t,r,o){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,r,o){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 r=this;EqpDynamicModuleDialogService.Confirm("Eliminare l'elemento selezionato?",(function(){r.form[t].splice(r.form[t].indexOf(e),1),"Fields"===t?(r.setFieldOrdinalPosition(),r.reloadFieldsTable()):"ActionsOnRecord"===t&&(r.setActionOrdinalPosition(),r.reloadActionsOnRecordTable())}),!1,"Richiesta conferma")},e.prototype.moveElement=function(e,t,r){var o=this.form[r].indexOf(e),n=o+(t?-1:1);this.form[r].splice(o,1),this.form[r].splice(n,0,e),"Fields"===r?(this.setFieldOrdinalPosition(),this.reloadFieldsTable()):"ActionsOnRecord"===r&&(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},{type:UtilityHelperService}]},__decorate([core.Input()],e.prototype,"context",void 0),__decorate([core.Input()],e.prototype,"form",void 0),__decorate([core.Input()],e.prototype,"formID",void 0),__decorate([core.Input()],e.prototype,"innerFormManagment",void 0),__decorate([core.Input()],e.prototype,"baseServerUrl",void 0),__decorate([core.Input()],e.prototype,"userToken",void 0),__decorate([core.Input()],e.prototype,"endPointConfiguration",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),__decorate([core.Output()],e.prototype,"afterSaveFormEvent",void 0),e=__decorate([core.Component({selector:"eqp-dynamic-module-configurator",template:'<eqp-dynamic-module-spinner></eqp-dynamic-module-spinner>\r\n\r\n<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 Anteprima\r\n </ng-template>\r\n\r\n <add-form-record *ngIf="previewForm && formCompleted" [form]="previewForm" [showButtons]="false">\r\n </add-form-record>\r\n\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\x3c!-- TEMPLATE PER CONFIGURARE LE FORM DI DETTAGLIO --\x3e\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),ButtonImage=function(){},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,r,o){this.formBuilder=e,this.enumHelper=t,this.dialog=r,this.cdr=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,this.TextMaskEnum=exports.TextMaskEnum,this.AttachmentType=eqpAttachments.AttachmentType}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],ColSpanSizes:[this.field.ColSpanSizes],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.onColSpanSizeSelect(),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.fieldFormGroup.addControl("DateFormat",new forms.FormControl(this.field.DateFormat)),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("DecimalSeparator",new forms.FormControl(this.field.DecimalSeparator)),this.fieldFormGroup.addControl("DecimalPrecision",new forms.FormControl(this.field.DecimalPrecision)),this.fieldFormGroup.addControl("ThousandsSeparator",new forms.FormControl(this.field.ThousandsSeparator)),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("EnableDrawing",new forms.FormControl(this.field.EnableDrawing)),this.fieldFormGroup.addControl("ImageIsContextualAttachment",new forms.FormControl(this.field.ImageIsContextualAttachment)),this.onImageIsContextualAttachmentChange(),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.InListView.disable()):(this.fieldFormGroup.controls.Formula.enable(),this.fieldFormGroup.controls.InListView.enable())},e.prototype.onImageIsContextualAttachmentChange=function(){this.field.ImgName=null,this.field.AttachDefinition.AllowedExtensions=[],this.field.AttachDefinition.IsMultiAttach=!1,this.field.ContextualAttachment=null,this.field.ImageIsContextualAttachment?(this.fieldFormGroup.removeControl("IsMultiAttach"),this.fieldFormGroup.removeControl("AllowedExtensions"),this.fieldFormGroup.addControl("ImgName",new forms.FormControl(this.field.ImgName,forms.Validators.required)),this.fieldFormGroup.addControl("ContextualAttachment",new forms.FormControl(this.field.ContextualAttachment,forms.Validators.required))):(this.fieldFormGroup.removeControl("ImgName"),this.fieldFormGroup.removeControl("ContextualAttachment"),this.fieldFormGroup.addControl("IsMultiAttach",new forms.FormControl(this.field.AttachDefinition.IsMultiAttach)),this.fieldFormGroup.addControl("AllowedExtensions",new forms.FormControl(this.field.AttachDefinition.AllowedExtensions)))},e.prototype.catchContextualAttachmentChange=function(e){e&&e.length>0?this.field.ContextualAttachment=e[0]:this.field.ContextualAttachment=null,this.fieldFormGroup.controls.ContextualAttachment.setValue(this.field.ContextualAttachment)},e.prototype.onColSpanSizeSelect=function(){var e=this.enumHelper.getEnumArray(exports.ColSpanSizesEnum,!1,null),t=this.field.ColSpanSizes?this.field.ColSpanSizes.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.onPresentationModeChange=function(){this.field.PresentationMode===exports.ListPresentationEnum.Immagini?this.field.ValuePairs=null:this.field.ButtonImageList=null},e.prototype.configureButtonImagesColumns=function(e){e.attachmentsColumns.splice(e.attachmentsColumns.length-1,0,{key:"ButtonKey",display:"Label",type:eqpTable.TypeColumn.ExternalTemplate,externalTemplate:this.buttonImagesKeyValueInputColumn}),e.attachmentsColumns.splice(e.attachmentsColumns.length-1,0,{key:"ButtonValue",display:"Valore",type:eqpTable.TypeColumn.ExternalTemplate,externalTemplate:this.buttonImagesKeyValueInputColumn}),this.cdr.detectChanges()},e.prototype.catchButtonImagesChange=function(e){this.field.ButtonImageList=e},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(r,o){return r.Label===e.Label&&(null==t.indexSelectedMetadata||t.indexSelectedMetadata!==o)}))||this.field.FieldType===exports.FieldTypeEnum.Immagine&&this.field.AttachDefinition.MetadataFields&&this.field.AttachDefinition.MetadataFields.find((function(r,o){return r.Label===e.Label&&(null==t.indexSelectedMetadata||t.indexSelectedMetadata!==o)})))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.PresentationMode!=exports.ListPresentationEnum.Immagini?!this.field.ValuePairs||0===this.field.ValuePairs.length:!this.field.ButtonImageList||0===this.field.ButtonImageList.length||!!this.field.ButtonImageList.find((function(e){return!e.ButtonKey||!e.ButtonValue}));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.ColSpanSizes=e.ColSpanSizes,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,r,o){return e.openMetadataDialog(t)}},{name:"Elimina",icon:"delete",fn:function(t,r,o){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},{type:core.ChangeDetectorRef}]},__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),__decorate([core.ViewChild("buttonImagesKeyValueInputColumn",{static:!0})],e.prototype,"buttonImagesKeyValueInputColumn",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;">\r\n <form [formGroup]="fieldFormGroup">\r\n <div class="row">\r\n <div class="header-title-standard">{{indexField != null && indexField >= 0 ? "Modifica"\r\n : "Aggiungi"}} campo</div>\r\n </div>\r\n <div class="row">\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <eqp-select [enumData]="FieldTypeEnum" [(ngModelInput)]="field.FieldType" [isRequired]="true"\r\n [showCancelButton]="false" placeholder="Tipo campo" (ngModelInputChange)="onFieldTypeChange()"\r\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'FieldType\'"\r\n [enumDataToExclude]="fieldTypesToExclude">\r\n </eqp-select>\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> Label </mat-label>\r\n <input formControlName="Label" required matInput [(ngModel)]="field.Label">\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> Descrizione </mat-label>\r\n <input formControlName="Description" required matInput [(ngModel)]="field.Description">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center">\r\n <mat-slide-toggle [(ngModel)]="field.Required" formControlName="Required" color="primary">\r\n Obbligatorio\r\n </mat-slide-toggle>\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> Formula (Javascript) </mat-label>\r\n <input formControlName="Formula" matInput [(ngModel)]="field.Formula"\r\n [matAutocomplete]="formulaAutocomplete" (keyup)="setFormulaAutocompleteOptions($event)"\r\n (focus)="setFormulaAutocompleteOptions(null)">\r\n <mat-autocomplete #formulaAutocomplete="matAutocomplete">\r\n <mat-option *ngFor="let option of formulaAutocompleteOptions" [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\r\n <div class="col-sm-12 col-md-4 mt-2" *ngIf="formFieldsGroups">\r\n <eqp-select [arrayData]="formFieldsGroups" [(ngModelInput)]="field.FieldGroup"\r\n [arrayKeyProperty]="\'Name\'" [arrayValueProperty]="\'Name\'" placeholder="Sezione"\r\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'FieldGroup\'" [isRequired]="true"\r\n [includeFullObject]="false">\r\n </eqp-select>\r\n </div>\r\n\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <eqp-select [arrayData]="availableColSpanSizes" [(ngModelInput)]="field.ColSpanSizes"\r\n [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'" (ngModelInputChange)="onColSpanSizeSelect()"\r\n [isMultiSelect]="true" placeholder="Larghezza campo" [formGroupInput]="fieldFormGroup"\r\n [formControlNameInput]="\'ColSpanSizes\'" [includeFullObject]="false">\r\n </eqp-select>\r\n </div>\r\n\r\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center">\r\n <mat-slide-toggle [(ngModel)]="field.InListView" formControlName="InListView" color="primary"\r\n [disabled]="fieldFormGroup.controls[\'InListView\'].disabled">\r\n Mostrare nella visualizzazione a lista\r\n </mat-slide-toggle>\r\n </div>\r\n\r\n <ng-container *ngTemplateOutlet="fieldTypeFormTemplate">\r\n </ng-container>\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)="saveAndExitAddField(true)"\r\n [disabled]="disableSaveField()" type="button">\r\n Salva\r\n </button>\r\n <button class="btn mat-raised-button" (click)="saveAndExitAddField(false)" type="button">\r\n Esci\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n</div>\r\n\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI DI TESTO --\x3e\r\n<ng-template #textFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4">\r\n <eqp-select [enumData]="TextMaskEnum" [(ngModelInput)]="field.TextMask" placeholder="Maschera"\r\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'TextMask\'">\r\n </eqp-select>\r\n </div>\r\n <div class="col-sm-12 col-md-4" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Lunghezza massima </mat-label>\r\n <input formControlName="MaxLenght" type="number" [min]="0" matInput [(ngModel)]="field.MaxLenght">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-4" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Lunghezza minima </mat-label>\r\n <input formControlName="MinLenght" type="number" [min]="0" matInput [(ngModel)]="field.MinLenght">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI AREA DI TESTO --\x3e\r\n<ng-template #textareaFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Righe </mat-label>\r\n <input formControlName="Rows" type="number" [min]="0" matInput [(ngModel)]="field.Rows">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Lunghezza massima </mat-label>\r\n <input formControlName="MaxLenght" type="number" [min]="0" matInput [(ngModel)]="field.MaxLenght">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Lunghezza minima </mat-label>\r\n <input formControlName="MinLenght" type="number" [min]="0" matInput [(ngModel)]="field.MinLenght">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI BOOLEANI --\x3e\r\n<ng-template #booleadFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\r\n <mat-slide-toggle [(ngModel)]="field.IsTristate" formControlName="IsTristate" color="primary">\r\n A tre stati\r\n </mat-slide-toggle>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <eqp-select [enumData]="BoolPresentantioEnum" [(ngModelInput)]="field.PresetationType" [isRequired]="true"\r\n [showCancelButton]="false" placeholder="Tipo di presentazione" [formGroupInput]="fieldFormGroup"\r\n [formControlNameInput]="\'PresetationType\'">\r\n </eqp-select>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI DATA --\x3e\r\n<ng-template #dateFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <eqp-datetimepicker [placeholder]="\'Data minima\'" [(ngModelInput)]="field.MinDate"\r\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'MinDate\'" [UTCDate]="true" [showSeconds]="false">\r\n </eqp-datetimepicker>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <eqp-datetimepicker [placeholder]="\'Data massima\'" [(ngModelInput)]="field.MaxDate"\r\n [formGroupInput]="fieldFormGroup" [formControlNameInput]="\'MaxDate\'" [UTCDate]="true" [showSeconds]="false">\r\n </eqp-datetimepicker>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <eqp-select [enumData]="DateTimeTypeEnum" [(ngModelInput)]="field.IsOnlyDate" [isRequired]="true"\r\n [showCancelButton]="false" placeholder="Tipo di data" [formGroupInput]="fieldFormGroup"\r\n [formControlNameInput]="\'IsOnlyDate\'">\r\n </eqp-select>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Formato </mat-label>\r\n <input formControlName="DateFormat" matInput [(ngModel)]="field.DateFormat"\r\n [matTooltip]="\'Indicare il formato senguendo la guida del pacchetto momentjs.\'">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI NUMERICI --\x3e\r\n<ng-template #numericFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\r\n <mat-slide-toggle [(ngModel)]="field.IsInteger" formControlName="IsInteger" color="primary">\r\n Valore intero\r\n </mat-slide-toggle>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Separatore decimali </mat-label>\r\n <input formControlName="DecimalSeparator" matInput [(ngModel)]="field.DecimalSeparator">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Precisione decimali </mat-label>\r\n <input formControlName="DecimalPrecision" type="number" [min]="0" matInput\r\n [(ngModel)]="field.DecimalPrecision">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Separatore migliaia </mat-label>\r\n <input formControlName="ThousandsSeparator" matInput [(ngModel)]="field.ThousandsSeparator">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Simbolo valuta </mat-label>\r\n <input formControlName="CurrencySymbol" matInput [(ngModel)]="field.CurrencySymbol">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Valore massimo </mat-label>\r\n <input formControlName="MinValue" type="number" [min]="0" matInput [(ngModel)]="field.MinValue">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field>\r\n <mat-label> Valore minimo </mat-label>\r\n <input formControlName="MaxValue" type="number" [min]="0" matInput [(ngModel)]="field.MaxValue">\r\n </mat-form-field>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI ALLEGATO --\x3e\r\n<ng-template #attachmentFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\r\n <mat-slide-toggle [(ngModel)]="field.IsMultiAttach" formControlName="IsMultiAttach" color="primary">\r\n Allegati multipli\r\n </mat-slide-toggle>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <eqp-select [arrayData]="AvailableFileExtensions.concat(AvailableImageExtensions)"\r\n [(ngModelInput)]="field.AllowedExtensions" [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'"\r\n [isMultiSelect]="true" placeholder="Estensioni accettate" [formGroupInput]="fieldFormGroup"\r\n [formControlNameInput]="\'AllowedExtensions\'" [includeFullObject]="false">\r\n </eqp-select>\r\n </div>\r\n <div class="col-sm-12 mt-2">\r\n <div class="row mt-2">\r\n <div class="col-sm-12 col-md-6">\r\n <div class="header-title-standard">\r\n Elenco metadata\r\n </div>\r\n </div>\r\n <div class="col-sm-12 col-md-6 text-right">\r\n <button class="btn btn-primary" mat-raised-button color="primary" type="button"\r\n (click)="openMetadataDialog()">\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 <eqp-table #metadataFieldsTable [createMatCard]="false" [columns]="metadataColumns"\r\n [data]="field.MetadataFields" [emptyTableMessage]="\'Nessun metadata inserito\'" [searchText]="\'Cerca\'">\r\n </eqp-table>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI IMMAGINE --\x3e\r\n<ng-template #imageFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\r\n <mat-slide-toggle [(ngModel)]="field.ImageIsContextualAttachment" formControlName="ImageIsContextualAttachment"\r\n color="primary" (ngModelChange)="onImageIsContextualAttachmentChange()">\r\n Immagine pre-caricata nel campo\r\n </mat-slide-toggle>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2 mb-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\r\n <mat-slide-toggle [(ngModel)]="field.EnableDrawing" formControlName="EnableDrawing" color="primary">\r\n Abilita il disegno\r\n </mat-slide-toggle>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup"\r\n *ngIf="!field.ImageIsContextualAttachment">\r\n <mat-slide-toggle [(ngModel)]="field.AttachDefinition.IsMultiAttach" formControlName="IsMultiAttach"\r\n color="primary">\r\n Immagini multiple\r\n </mat-slide-toggle>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" *ngIf="!field.ImageIsContextualAttachment">\r\n <eqp-select [arrayData]="AvailableImageExtensions" [(ngModelInput)]="field.AttachDefinition.AllowedExtensions"\r\n [arrayKeyProperty]="\'key\'" [arrayValueProperty]="\'value\'" [isMultiSelect]="true"\r\n placeholder="Estensioni accettate" [formGroupInput]="fieldFormGroup"\r\n [formControlNameInput]="\'AllowedExtensions\'" [includeFullObject]="false">\r\n </eqp-select>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup" *ngIf="field.ImageIsContextualAttachment">\r\n <mat-form-field>\r\n <mat-label> Nome immagine </mat-label>\r\n <input formControlName="ImgName" matInput [(ngModel)]="field.ImgName" required>\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 col-md-8 mt-2" [formGroup]="fieldFormGroup" *ngIf="field.ImageIsContextualAttachment">\r\n <eqp-attachments [attachmentsList]="field._contextualAttachments" [showMatCard]="false" [allowOnlyImages]="true"\r\n [isDisabled]="false" [showInlinePreview]="true" [multipleAttachment]="false" [showHeader]="false"\r\n (localEditedAttachments)="catchContextualAttachmentChange($event)" #contextualAttachmentEqpAttachments>\r\n </eqp-attachments>\r\n </div>\r\n <div class="col-sm-12 mt-2">\r\n <div class="row mt-2">\r\n <div class="col-sm-12 col-md-6">\r\n <div class="header-title-standard">\r\n Elenco metadata\r\n </div>\r\n </div>\r\n <div class="col-sm-12 col-md-6 text-right">\r\n <button class="btn btn-primary" mat-raised-button color="primary" type="button"\r\n (click)="openMetadataDialog()">\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 <eqp-table #metadataFieldsTable [createMatCard]="false" [columns]="metadataColumns"\r\n [data]="field.AttachDefinition.MetadataFields" [emptyTableMessage]="\'Nessun metadata inserito\'"\r\n [searchText]="\'Cerca\'">\r\n </eqp-table>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI LISTA DI VALORI --\x3e\r\n<ng-template #listValueFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\r\n <mat-slide-toggle [(ngModel)]="field.IsMultiChoiche" formControlName="IsMultiChoiche" color="primary">\r\n Scelta multipla\r\n </mat-slide-toggle>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2">\r\n <eqp-select [enumData]="ListPresentationEnum" [(ngModelInput)]="field.PresentationMode" [isRequired]="true"\r\n [showCancelButton]="false" placeholder="Tipo di presentazione" [formGroupInput]="fieldFormGroup"\r\n [formControlNameInput]="\'PresentationMode\'" (ngModelInputChange)="onPresentationModeChange()">\r\n </eqp-select>\r\n </div>\r\n <div class="col-sm-12 mt-2" *ngIf="field.PresentationMode != ListPresentationEnum.Immagini">\r\n <div class="row">\r\n <h4 class="key-value-list-section-title"> </h4>\r\n <div class="col-md-4 d-flex align-items-center">\r\n <mat-form-field>\r\n <mat-label> Label opzione (invio per confermare)</mat-label>\r\n <input matInput [(ngModel)]="keyValueObject.key" (keyup)="onMultiSelectInputKeyup($event, null)">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-md-4 d-flex align-items-center">\r\n <mat-form-field>\r\n <mat-label> Valore opzione (invio per confermare)</mat-label>\r\n <input matInput [(ngModel)]="keyValueObject.value" (keyup)="onMultiSelectInputKeyup($event, null)">\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">Opzioni inserite:</span>\r\n <ul class="value-pairs-list">\r\n <li *ngFor="let keyValuePair of getDictionaryKeyValue()">\r\n <mat-icon class="mr-1" (click)="deleteKeyFromDictionary(keyValuePair.key)">close\r\n </mat-icon>\r\n <span><b>Label: </b> {{keyValuePair.key}} - <b>Valore: </b> {{keyValuePair.value}}</span>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="col-sm-12 col-md-12 mt-2" *ngIf="field.PresentationMode == ListPresentationEnum.Immagini">\r\n <eqp-attachments [attachmentsList]="field.ButtonImageList" [showMatCard]="false" [allowOnlyImages]="true"\r\n [isDisabled]="false" [showInlinePreview]="true" [multipleAttachment]="true" [showHeader]="false"\r\n [allowedTypes]="[AttachmentType.FILE]" (localEditedAttachments)="catchButtonImagesChange($event)"\r\n (onComponentLoaded)="configureButtonImagesColumns($event)">\r\n </eqp-attachments>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- FORM PROPRIETÀ CAMPI LOOKUP --\x3e\r\n<ng-template #lookupFieldFormTemplate>\r\n <div class="col-sm-12 col-md-4 mt-2 d-flex align-items-center" [formGroup]="fieldFormGroup">\r\n <mat-slide-toggle [(ngModel)]="field.UseAsGetOrDiscard" formControlName="UseAsGetOrDiscard" color="primary"\r\n matTooltip="Se true la lookup viene visualizzata in una modale per lo scegli scarta">\r\n Usa per scegli o scarta\r\n </mat-slide-toggle>\r\n </div>\r\n <div class="col-sm-12 col-md-4 mt-2" [formGroup]="fieldFormGroup">\r\n <mat-form-field matTooltip="Nome dell\'entità relazionata">\r\n <mat-label> Nome entità </mat-label>\r\n <input formControlName="EntitySourceName" required matInput [(ngModel)]="field.EntitySourceName">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-sm-12 mt-2">\r\n <div class="row">\r\n <div class="col-md-4">\r\n <mat-form-field\r\n matTooltip="Elenco di campi ordinato che verrà visualizzato nella lookup (premere invio per confermare)">\r\n <mat-label>\r\n Nomi dei campi (invio per confermare) </mat-label>\r\n <input matInput (keyup)="onMultiSelectInputKeyup($event, \'FieldNames\')">\r\n </mat-form-field>\r\n </div>\r\n <div class="col-md-8 d-flex align-items-center">\r\n <span class="mr-3">Nomi selezionati:</span>\r\n <div class="extension-container" *ngFor="let extension of field.FieldNames; let i = index">\r\n <span>{{extension}}</span>\r\n <mat-icon class="ml-1" (click)="field.FieldNames.splice(i,1)">close\r\n </mat-icon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\x3c!-- DIALOG PER AGGIUNGERE UN METADATA NEI CAMPI DI TIPO ALLEGATO O IMMAGINE --\x3e\r\n<ng-template #dialogMetadata>\r\n <eqp-dynamic-module-add-form-field [field]="selectedMetadata" [availableFields]="availableFields"\r\n [indexField]="indexSelectedMetadata" (saveFieldEvent)="onSaveMetadata($event)" [fieldTypesToExclude]="[6,7,10]">\r\n </eqp-dynamic-module-add-form-field>\r\n</ng-template>\r\n\r\n<ng-template #buttonImagesKeyValueInputColumn let-row="row" let-col="col">\r\n <mat-form-field>\r\n <mat-label> {{col.display}} </mat-label>\r\n <input matInput [(ngModel)]="row[col.key]" required>\r\n </mat-form-field>\r\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,this.InputMaskEnum=exports.TextMaskEnum}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.getInputType=function(){switch(this.field.TextMask){case exports.TextMaskEnum.Email:return"email";case exports.TextMaskEnum.Password:return"password";case exports.TextMaskEnum.Telefono:return"tel";case exports.TextMaskEnum.Url:return"url";default:return"text"}},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]="getInputType()" [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">\r\n\r\n \x3c!-- VISUALIZZAZIONE A TOGGLE --\x3e\r\n <mat-slide-toggle color="primary" *ngIf="field.PresetationType == BoolPresentantioEnum.Toggle"\r\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\r\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\r\n {{field.Label + (field.Required ? " *" : "")}}\r\n </mat-slide-toggle>\r\n\r\n\r\n \x3c!-- VISUALIZZAZIONE A RADIOBUTTON --\x3e\r\n <mat-label class="mr-3" *ngIf="field.PresetationType == BoolPresentantioEnum[\'Radio button\']">\r\n {{field.Label + (field.Required ? " *" : "")}}\r\n </mat-label>\r\n <mat-radio-group *ngIf="field.PresetationType == BoolPresentantioEnum[\'Radio button\']"\r\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\r\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\r\n <mat-radio-button class="mr-2" [value]="true" color="primary"> Si </mat-radio-button>\r\n <mat-radio-button class="mr-2" [value]="false" color="primary"> No </mat-radio-button>\r\n <mat-radio-button class="mr-2" [value]="null" color="primary" *ngIf="field.IsTristate"> ND\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n\r\n \x3c!-- VISUALIZZAZIONE A CHECKBOX --\x3e\r\n <mat-checkbox class="mr-2" *ngIf="field.PresetationType == BoolPresentantioEnum.Checkbox"\r\n [disabled]="field.FormFormGroup.disabled" [required]="field.Required" [formControlName]="field.Name"\r\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\r\n {{field.Label + (field.Required ? " *" : "")}}\r\n </mat-checkbox>\r\n\r\n \x3c!-- TODO: Visualizzazione "Stringa true o false" e "Numerico 0 o 1" ?? --\x3e\r\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"\r\n [formGroupInput]="field.FormFormGroup" [formControlNameInput]="field.Name"\r\n [minDate]="field.MinDate ? field.MinDate : null" [maxDate]="field.MaxDate ? field.MaxDate : null"\r\n [isRequired]="field.Required" [disabled]="field.FormFormGroup.disabled" [(ngModelInput)]="record[field.Name]"\r\n (ngModelInputChange)="onRecordValueChange()" [customDateFormat]="field.DateFormat ? field.DateFormat : null">\r\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">\r\n <textarea matInput [placeholder]="field.Label" [rows]="field.Rows" [formControlName]="field.Name"\r\n [disabled]="field.FormFormGroup.disabled" [required]="field.Required" [(ngModel)]="record[field.Name]"\r\n (ngModelChange)="onRecordValueChange()"></textarea>\r\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:"",this.eqpNumericOptions.inputMode=this.field.CurrencySymbol?eqpNumeric.EqpNumericInputMode.FINANCIAL:eqpNumeric.EqpNumericInputMode.NATURAL,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),null!=this.field.DecimalSeparator&&null!=this.field.DecimalSeparator&&(this.eqpNumericOptions.decimal=this.field.DecimalSeparator),null!=this.field.ThousandsSeparator&&null!=this.field.ThousandsSeparator&&(this.eqpNumericOptions.thousands=this.field.ThousandsSeparator),null!=this.field.DecimalPrecision&&null!=this.field.DecimalPrecision&&(this.eqpNumericOptions.precision=this.field.DecimalPrecision)},__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">\r\n <mat-label> {{field.Label}} </mat-label>\r\n <input matInput eqpNumericMask [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled"\r\n [required]="field.Required" [(ngModel)]="record[field.Name]" [options]="eqpNumericOptions"\r\n [step]="field.IsInteger ? 1 : null" (ngModelChange)="onRecordValueChange()" />\r\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.buttonSelectClick=function(e){e.Selected=!e.Selected,this.field.IsMultiChoiche?this.updateSelected(!1):(this.arrayData.filter((function(t){return t.Key!=e.Key&&t.Value!=e.Value})).forEach((function(e){return e.Selected=!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;this.field.PresentationMode!=exports.ListPresentationEnum.Immagini?Object.keys(this.field.ValuePairs).forEach((function(t){e.createArrayDataElement(t,e.field.ValuePairs[t])})):this.field.ButtonImageList.forEach((function(t){e.createArrayDataElement(t.ButtonKey,t.ButtonValue,"data:"+t.FileContentType+";base64,"+t.FileDataBase64)}))},e.prototype.createArrayDataElement=function(e,t,r){var o;void 0===r&&(r=null),o=this.field.IsMultiChoiche&&this.record[this.field.Name]&&this.record[this.field.Name].length>0?!!this.record[this.field.Name].find((function(e){return e==t})):this.record[this.field.Name]===t,this.arrayData.push({Key:e,Value:t,Selected:o,ImgUrl:r})},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"\r\n [arrayKeyProperty]="\'Value\'" [showCancelButton]="!field.Required" [arrayValueProperty]="\'Key\'"\r\n [formGroupInput]="field.FormFormGroup" [formControlNameInput]="field.Name" [placeholder]="field.Label"\r\n [includeFullObject]="false" [isRequired]="field.Required" [isDisabled]="field.FormFormGroup.disabled"\r\n [(ngModelInput)]="record[field.Name]" [isMultiSelect]="field.IsMultiChoiche"\r\n (ngModelInputChange)="onRecordValueChange()">\r\n</eqp-select>\r\n\r\n<div *ngIf="field.PresentationMode != ListPresentationEnum[\'Combo box\']" [formGroup]="field.FormFormGroup">\r\n\r\n <mat-label class="mr-3"> {{field.Label + (field.Required ? " *" : "")}} </mat-label>\r\n\r\n \x3c!-- VISUALIZZAZIONE A RADIO BUTTON (SENZA SELEZIONE MULTIPLA) --\x3e\r\n <mat-radio-group *ngIf="field.PresentationMode == ListPresentationEnum[\'Radio button\'] && !field.IsMultiChoiche"\r\n [formControlName]="field.Name" [disabled]="field.FormFormGroup.disabled" [required]="field.Required"\r\n [(ngModel)]="record[field.Name]" (ngModelChange)="onRecordValueChange()">\r\n <mat-radio-button class="mr-2" *ngFor="let data of arrayData" [value]="data.Value" color="primary">\r\n {{data.Key}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n\r\n \x3c!-- VISUALIZZAZIONE A CHECKBOX (SELEZIONE MULTIPLA) --\x3e\r\n <div class="d-inline-block"\r\n *ngIf="field.PresentationMode == ListPresentationEnum[\'Radio button\'] && field.IsMultiChoiche">\r\n <mat-checkbox class="mr-2" *ngFor="let data of arrayData" [disabled]="field.FormFormGroup.disabled"\r\n [formControlName]="field.Name" [(ngModel)]="data.Selected" (ngModelChange)="updateSelected()">\r\n {{data.Key}}\r\n </mat-checkbox>\r\n </div>\r\n\r\n \x3c!-- VISUALIZZAZIONE A PULSANTI (CON TESTO O IMMAGINI) --\x3e\r\n <div class="d-inline-block"\r\n *ngIf="[ListPresentationEnum[\'Pulsante con testo\'], ListPresentationEnum.Immagini].includes(field.PresentationMode)">\r\n <button mat-raised-button color="primary" class="btn btn-primary m-1 data-button" *ngFor="let data of arrayData"\r\n [ngClass]="{\'selected-button\': data.Selected == true, \'p-0\': field.PresentationMode == ListPresentationEnum.Immagini}"\r\n (click)="buttonSelectClick(data)" [disabled]="field.FormFormGroup.disabled">\r\n\r\n \x3c!-- TESTO DEL PULSANTE --\x3e\r\n <span *ngIf="field.PresentationMode == ListPresentationEnum[\'Pulsante con testo\']"> {{data.Key}}</span>\r\n\r\n \x3c!-- IMMAGINE DEL PULSANTE --\x3e\r\n <img *ngIf="field.PresentationMode == ListPresentationEnum.Immagini" [src]="data.ImgUrl">\r\n </button>\r\n </div>\r\n\r\n</div>',styles:[".selected-button{opacity:.7}.selected-button:disabled{background-color:var(--primary)!important;opacity:.3;color:#fff}.data-button img{max-height:300px;max-width:300px}"]})],e)}(),AttachmentFieldTemplateComponent=function(){function e(e,t){this.utilityService=e,this.cdr=t,this.onlyImages=!1,this.recordChange=new core.EventEmitter,this.onAttachmentsChange=new core.EventEmitter,this.metadataFormGroups=new Array}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.onAttachmentsChange.emit(),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 r=JSON.parse(JSON.stringify(this.field.MetadataFields.find((function(t){return t.Name===e.key}))));return r.FormFormGroup=this.metadataFormGroups[this.record[this.field.Name].indexOf(t)],r},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.Output()],e.prototype,"onAttachmentsChange",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">\r\n {{field.Label + (field.Required ? " *" : "")}}\r\n</p>\r\n<div class="row" *ngIf="!field.IsMultiAttach && record[field.Name] && record[field.Name][0]">\r\n <div class="mt-2" *ngFor="let metadata of field.MetadataFields"\r\n [ngClass]="utilityService.getFieldSyleClass(metadata)">\r\n <dynamic-module-field [field]="metadata" [record]="record[field.Name][0]"\r\n (recordChange)="updateMetadataValidity()">\r\n </dynamic-module-field>\r\n </div>\r\n</div>\r\n\r\n<eqp-attachments [attachmentsList]="record[field.Name]" [showMatCard]="true" [allowOnlyImages]="onlyImages"\r\n [isDisabled]="field.FormFormGroup.disabled" [showInlinePreview]="true" [multipleAttachment]="field.IsMultiAttach"\r\n [disableAction]="field.FormFormGroup.disabled" [acceptedFileTypes]="field.AllowedExtensions" [showHeader]="true"\r\n [headerTitle]="field.Label + (field.Required ? \' *\' : \'\')" (localEditedAttachments)="catchAttachmentList($event)"\r\n #eqpAttachments>\r\n</eqp-attachments>\r\n\r\n\x3c!-- TEMPLATE PER VISUALIZZARE LA COLONNA DELLA SEZIONE NELLA TABELLA DEI FIELDS --\x3e\r\n<ng-template #metadataColumnTemplate let-row="row" let-col="col">\r\n <dynamic-module-field [field]="getFieldFromMetadata(col, row)" [record]="row"\r\n (recordChange)="updateMetadataValidity()">\r\n </dynamic-module-field>\r\n</ng-template>',styles:[""]})],e)}(),toBase64=function(e){return new Promise((function(t,r){var o=new FileReader;o.readAsDataURL(e),o.onload=function(){return t(o.result.toString())},o.onerror=function(e){return r(e)}}))},ɵ0=toBase64,ImageFieldTemplateComponent=function(){function e(e,t){this.dialog=e,this.utilityService=t,this.recordChange=new core.EventEmitter,this.width=null,this.height=null,this.i18n={saveBtn:"Salva modifiche",cancelBtn:"Ricarica originale"}}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,this.field.ImageIsContextualAttachment&&this.field.ContextualAttachment&&(this.record[this.field.Name]&&Array.isArray(this.record[this.field.Name])&&this.record[this.field.Name].length>0||(this.record[this.field.Name]=[JSON.parse(JSON.stringify(this.field.ContextualAttachment))]),this.preLoadedImageMetadataFormGroup=this.utilityService.CreateFormFormGroup(this.field.AttachDefinition.MetadataFields,this.record[this.field.Name][0]),this.getImageDimensions())},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.updateMetadataValidity=function(){this.preLoadedImageMetadataFormGroup.invalid?this.field.FormFormGroup.controls[this.field.Name].setErrors({incorrect:!0}):this.field.FormFormGroup.controls[this.field.Name].setErrors(null),this.onRecordValueChange()},e.prototype.updateField=function(){this.field.Formula&&(this.record[this.field.Name]=UtilityHelperService.EvaluateFieldFormula(this.field.Formula,this.record,null))},e.prototype.resetPreLoadedImage=function(){this.width=null,this.height=null,this.record[this.field.Name]=[JSON.parse(JSON.stringify(this.field.ContextualAttachment))],this.getImageDimensions()},e.prototype.onAttachmentsChange=function(){!this.field.AttachDefinition.IsMultiAttach&&this.field.EnableDrawing&&this.record[this.field.Name]&&this.record[this.field.Name][0]&&(this.getImageDimensions(),this.dialogImageDrowingRef=this.dialog.open(this.dialogImageDrowing,{disableClose:!0,hasBackdrop:!0,width:"75%"}))},e.prototype.saveDrowning=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,toBase64(e)];case 1:return(t=r.sent())&&(this.record[this.field.Name][0].FileContentType=t.split(",")[0].split(":")[1].split(";")[0],this.record[this.field.Name][0].FileDataBase64=t.split(",")[1]),this.dialogImageDrowingRef&&this.closeImageDrowingDialog(),[2]}}))}))},e.prototype.closeImageDrowingDialog=function(){this.dialogImageDrowingRef.close(),this.width=null,this.height=null},e.prototype.getImageDimensions=function(){var e=this,t=this.getBlobFromBase64(),r=new FileReader;r.onload=function(t){var r=new Image;r.src=t.target.result,r.onload=function(t){e.height=t.currentTarget.height,e.width=t.currentTarget.width}},r.readAsDataURL(t)},e.prototype.getBlobFromBase64=function(){for(var e=atob(this.record[this.field.Name][0].FileDataBase64),t=new Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);var o=new Uint8Array(t);return new Blob([o],{type:this.record[this.field.Name][0].FileContentType})},e.prototype.onRecordValueChange=function(){this.field.Formula||this.recordChange.emit(this.record)},e.ctorParameters=function(){return[{type:dialog.MatDialog},{type:UtilityHelperService}]},__decorate([core.Input()],e.prototype,"record",void 0),__decorate([core.Input()],e.prototype,"field",void 0),__decorate([core.Output()],e.prototype,"recordChange",void 0),__decorate([core.ViewChild("dialogImageDrowing",{static:!0})],e.prototype,"dialogImageDrowing",void 0),e=__decorate([core.Component({selector:"image-field-template",template:'\x3c!-- VISUALIZZAZIONE ALLEGATO PRE CARICATO CON POSSIBILITA\' DI DISEGNO --\x3e\r\n<div class="row" *ngIf="field.ImageIsContextualAttachment && field.ContextualAttachment">\r\n <div class="col-sm-12 col-md-6 col-lg-4">\r\n <p class="mb-2">\r\n {{ field.Label + (field.Required ? " *" : "")}}\r\n <br>\r\n Nome immagine: {{ field.ImgName}}\r\n </p>\r\n <eqp-img-drawing\r\n *ngIf="field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null"\r\n [src]="\'data:\'+ record[field.Name][0].FileContentType + \';base64,\'+ record[field.Name][0].FileDataBase64"\r\n [showCancelButton]="false" [enableLoadAnotherImage]="false" [enableRemoveImage]="false" [width]="width"\r\n [height]="height" [i18n]="i18n" [showCancelButton]="true" (save)="saveDrowning($event)"\r\n (cancel)="resetPreLoadedImage()">\r\n </eqp-img-drawing>\r\n\r\n <img *ngIf="!field.EnableDrawing"\r\n [src]="\'data:\'+ record[field.Name][0].FileContentType+ \';base64,\'+ record[field.Name][0].FileDataBase64">\r\n </div>\r\n\r\n <div class="col-sm-12 col-md-6 col-lg-8">\r\n <div class="row"\r\n *ngIf="field.AttachDefinition && field.AttachDefinition.MetadataFields && preLoadedImageMetadataFormGroup">\r\n <div class="mt-2" *ngFor="let metadata of field.AttachDefinition.MetadataFields"\r\n [ngClass]="utilityService.getFieldSyleClass(metadata)">\r\n <dynamic-module-field #fieldTemplate [field]="metadata" [form]="preLoadedImageMetadataFormGroup"\r\n [record]="record[field.Name][0]" (recordChange)="updateMetadataValidity()">\r\n </dynamic-module-field>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- COMPONENTE IN CUI CARICARE NUOVI ALLEGATI --\x3e\r\n<attachment-field-template [(record)]="record" [field]="field.AttachDefinition" [onlyImages]="true"\r\n (onAttachmentsChange)="onAttachmentsChange()" *ngIf="!field.ImageIsContextualAttachment">\r\n</attachment-field-template>\r\n\r\n\x3c!-- DIALOG PER DISEGNARE SUL NUOVO ALLEGATO CARICATO --\x3e\r\n<ng-template #dialogImageDrowing>\r\n <div *ngIf="field.EnableDrawing && record[field.Name] && record[field.Name][0] && width != null && height != null"\r\n class="row">\r\n <div class="col-sm-12 col-md-12">\r\n <eqp-img-drawing [showCancelButton]="false" [enableLoadAnotherImage]="false" [enableRemoveImage]="false"\r\n [src]="\'data:\'+ record[field.Name][0].FileContentType + \';base64,\'+ record[field.Name][0].FileDataBase64"\r\n [i18n]="i18n" [showCancelButton]="false" (save)="saveDrowning($event)">\r\n </eqp-img-drawing>\r\n </div>\r\n </div>\r\n <div class="row mt-2 mb-1">\r\n <div class="col-sm-12 text-right">\r\n <button class="btn mat-raised-button" (click)="closeImageDrowingDialog()" type="button">\r\n Annulla disegno\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>',styles:["::ng-deep image-drawing>button{background-color:var(--primary)!important;color:#fff!important}"]})],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,r,o){return e.viewOrEditRecord(t,!0)}},{name:"Modifica",icon:"edit",fn:function(t,r,o){return e.viewOrEditRecord(t,!1)}},{name:"Duplica",icon:"file_copy",fn:function(t,r,o){return e.duplicateRecord(t)}},{name:"Elimina",icon:"delete",fn:function(t,r,o){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=e.DateFormat?e.DateFormat.replace("DD","dd"):"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(r){return t[e.Name].includes(e.ValuePairs[r])})).join(", "):null:Object.keys(e.ValuePairs).find((function(r){return e.ValuePairs[r]==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}(),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(r){t.find((function(e){return e===r.Name}))||(e.record[r.Name]=null)})),this.form.InnerForms&&this.form.InnerForms.length>0&&this.form.InnerForms.forEach((function(r){var o=r.Name.split(" ").join("_");t.find((function(e){return e===o}))||(e.record[o]=[])}))},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">\r\n <div class="col-md-12">\r\n <h4><b>{{form.Name}}</b></h4>\r\n </div>\r\n</div>\r\n\r\n<form [formGroup]="formForm">\r\n\r\n \x3c!-- VISUALIZZAZIONE SEMPLICE --\x3e\r\n <ng-container *ngIf="form.FormScalarType == FormScalarTypeEnum.Semplice" [ngTemplateOutlet]="fieldTemplates"\r\n [ngTemplateOutletContext]="{ fields: form.Fields }">\r\n </ng-container>\r\n\r\n \x3c!-- VISUALIZZAZIONE A STEPPER --\x3e\r\n <mat-horizontal-stepper linear *ngIf="form.FormScalarType == FormScalarTypeEnum[\'A step\']">\r\n <mat-step *ngFor="let group of form.FormFieldsGroups">\r\n <ng-template matStepLabel>\r\n {{group.Name}}\r\n </ng-template>\r\n\r\n <ng-container [ngTemplateOutlet]="fieldTemplates"\r\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\r\n </ng-container>\r\n </mat-step>\r\n </mat-horizontal-stepper>\r\n\r\n \x3c!-- VISUALIZZAZIONE A TAB --\x3e\r\n <mat-tab-group *ngIf="form.FormScalarType == FormScalarTypeEnum[\'In tab\']">\r\n <mat-tab *ngFor="let group of form.FormFieldsGroups" [label]="group.Name">\r\n <div class="mt-3">\r\n <ng-container [ngTemplateOutlet]="fieldTemplates"\r\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\r\n </ng-container>\r\n </div>\r\n </mat-tab>\r\n </mat-tab-group>\r\n\r\n \x3c!-- VISUALIZZAZIONE AD ACCORDION --\x3e\r\n <mat-accordion multi *ngIf="form.FormScalarType == FormScalarTypeEnum[\'In accordion\']">\r\n <mat-expansion-panel *ngFor="let group of form.FormFieldsGroups">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n {{group.Name}}\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n\r\n <ng-container [ngTemplateOutlet]="fieldTemplates"\r\n [ngTemplateOutletContext]="{ fields: fieldGroups[group.Name] }">\r\n </ng-container>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n</form>\r\n\r\n<div class="row mt-2" *ngIf="showButtons">\r\n <div class="col-sm-12 text-right">\r\n <button class="mr-2" mat-raised-button (click)="saveOrExitForm(true)" type="button">\r\n Annulla\r\n </button>\r\n <button class="mr-2" mat-raised-button color="primary" (click)="saveOrExitForm(false)"\r\n [disabled]="formForm.invalid || formForm.disabled" type="button">\r\n Salva\r\n </button>\r\n </div>\r\n</div>\r\n\r\n\x3c!-- TEMPLATE PER LA VISUALIZZAZIONE DEI CAMPI DELLA FORM --\x3e\r\n<ng-template #fieldTemplates let-fields=\'fields\'>\r\n <div class="row">\r\n <div class="mt-2" *ngFor="let field of fields" [ngClass]="utilityService.getFieldSyleClass(field)">\r\n <dynamic-module-field #fieldTemplate [field]="field" [form]="form" [record]="record"\r\n (recordChange)="onRecordChange()"></dynamic-module-field>\r\n </div>\r\n </div>\r\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\']"\r\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\r\n</text-field-template>\r\n\r\n<textarea-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Area di testo\']"\r\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\r\n</textarea-field-template>\r\n\r\n<boolean-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Booleano\']"\r\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\r\n</boolean-field-template>\r\n\r\n<date-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Data e/o ora\']"\r\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\r\n</date-field-template>\r\n\r\n<numeric-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Campo numerico\']"\r\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\r\n</numeric-field-template>\r\n\r\n<list-value-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Elenco generico\']"\r\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\r\n</list-value-field-template>\r\n\r\n<attachment-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Allegato\']"\r\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\r\n</attachment-field-template>\r\n\r\n<image-field-template #fieldTemplate *ngIf="field.FieldType == FieldTypeEnum[\'Immagine\']"\r\n [matTooltip]="field.Description" [(record)]="record" [field]="field" (recordChange)="onRecordChange()">\r\n</image-field-template>\r\n\r\n<list-form-record #listInnerFormRecords *ngIf="field.FieldType == FieldTypeEnum[\'Form di dettaglio\']"\r\n [form]="getInnerFormFromField(field)" [values]="record[field.Name]"\r\n (onAddViewEditRecord)="onAddViewEditInnerFormRecord($event, field)">\r\n</list-form-record>\r\n\r\n\x3c!-- DIALOG PER AGGIUNGERE/MODIFICARE/VISUALIZZARE UN RECORD IN UNA FORM DI DETTAGLIO --\x3e\r\n<ng-template #dialogInnerFormRecord>\r\n <add-form-record [form]="selectedInnerForm" [record]="selectedInnerFormRecord" [onlyView]="onlyViewInnerFormRecord"\r\n (saveRecordEvent)="onSaveInnerFormRecord($event)"></add-form-record>\r\n</ng-template>',styles:[""]})],e)}(),SpinnerComponent=function(){function e(e){this.spinnerService=e,this.isLoading=this.spinnerService.isLoading}return e.prototype.ngOnInit=function(){},e.ctorParameters=function(){return[{type:SpinnerService}]},e=__decorate([core.Component({selector:"eqp-dynamic-module-spinner",template:'<div class="eqp-splash-screen" *ngIf="isLoading | async">\r\n <div id="loader"></div>\r\n</div>',styles:[':host #loader{display:block;position:relative;width:150px;height:150px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:2s linear infinite spin;animation:2s linear infinite spin}:host #loader:before{content:"";position:absolute;top:5px;left:5px;right:5px;bottom:5px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:3s linear infinite spin;animation:3s linear infinite spin}:host #loader:after{content:"";position:absolute;top:15px;left:15px;right:15px;bottom:15px;border-radius:50%;border:3px solid transparent;border-top-color:var(--primary);-webkit-animation:1.5s linear infinite spin;animation:1.5s linear infinite spin}@-webkit-keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}:host .eqp-splash-screen{background-color:#343a4040;position:fixed;display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;z-index:9999}:host .eqp-splash-screen img{margin-left:calc(100vw - 100%);width:90px;margin-bottom:30px}:host .eqp-splash-screen span{margin-left:calc(100vw - 100%);margin-bottom:30px}:host .eqp-splash-screen ::ng-deep .mat-progress-spinner circle,:host .eqp-splash-screen ::ng-deep .mat-spinner circle{stroke:#5d78ff}']})],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,SpinnerComponent],imports:[MaterialModule,forms.FormsModule,common.CommonModule,forms.ReactiveFormsModule,eqpTable.EqpTableModule,eqpAttachments.EqpAttachmentsModule,eqpSelect.EqpSelectModule,eqpDatetimepicker.EqpDatetimepickerModule,eqpFilters.EqpFiltersModule,eqpNumeric.EqpNumericModule,eqpImgDrawing.EqpImgDrawingModule],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),Object.defineProperty(t.prototype,"_contextualAttachments",{get:function(){return this.ContextualAttachment?[this.ContextualAttachment]:[]},enumerable:!0,configurable:!0}),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);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.ButtonImage=ButtonImage,exports.Context=Context,exports.ContextUser=ContextUser,exports.DateField=DateField,exports.DateFieldTemplateComponent=DateFieldTemplateComponent,exports.DynRecord=DynRecord,exports.DynamicModuleFieldComponent=DynamicModuleFieldComponent,exports.EndPointConfiguration=EndPointConfiguration,exports.EndPointData=EndPointData,exports.EndPointDataParams=EndPointDataParams,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.SpinnerService=SpinnerService,exports.TelRegex=TelRegex,exports.TextField=TextField,exports.TextFieldTemplateComponent=TextFieldTemplateComponent,exports.TextareaField=TextareaField,exports.TextareaFieldTemplateComponent=TextareaFieldTemplateComponent,exports.UrlRegex=UrlRegex,exports.UtilityHelperService=UtilityHelperService,exports.ɵ0=ɵ0,exports.ɵa=SpinnerComponent,exports.ɵb=MaterialModule,Object.defineProperty(exports,"__esModule",{value:!0})}));
|
|
17
17
|
//# sourceMappingURL=eqproject-eqp-dynamic-module.umd.min.js.map
|