@fluxhub/fluxhub-lib 9.0.137 → 9.0.139

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('ngx-toastr'), require('ngx-simple-crypt'), require('crypto-js'), require('recursive-diff'), require('rxjs/operators'), require('@angular/forms'), require('@angular/material/dialog'), require('ng2-file-upload'), require('@angular/router'), require('ng2-slim-loading-bar'), require('ag-grid-enterprise'), require('@angular/material/select'), require('rxjs'), require('@angular/material/slide-toggle'), require('@angular/material/autocomplete'), require('moment'), require('@angular/material/core'), require('@angular/common'), require('clipboard'), require('prismjs'), require('prismjs/plugins/toolbar/prism-toolbar'), require('prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard'), require('prismjs/components/prism-css'), require('prismjs/components/prism-javascript'), require('prismjs/components/prism-java'), require('prismjs/components/prism-markup'), require('prismjs/components/prism-typescript'), require('prismjs/components/prism-sass'), require('prismjs/components/prism-scss'), require('prismjs/components/prism-sql'), require('bpmn-js/lib/NavigatedViewer'), require('@angular/material/tabs'), require('@angular/flex-layout'), require('ngx-markdown'), require('ag-grid-angular'), require('@agm/core'), require('@angular/cdk/table'), require('ngforage'), require('@ngx-translate/core'), require('ng2-dragula'), require('@angular/platform-browser'), require('@angular/material/card'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/button-toggle'), require('@angular/material/chips'), require('@angular/material/datepicker'), require('@angular/material/expansion'), require('@angular/material/form-field'), require('@angular/material/grid-list'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/list'), require('@angular/material/menu'), require('@angular/material/progress-bar'), require('@angular/material/progress-spinner'), require('@angular/material/radio'), require('@angular/material/slider'), require('@angular/material/sidenav'), require('@angular/material/snack-bar'), require('@angular/material/stepper'), require('@angular/material/toolbar'), require('@angular/material/tooltip'), require('@angular/material/paginator'), require('@angular/material/sort'), require('@angular/material/table'), require('@angular/material/badge'), require('ngx-quill')) :
3
- typeof define === 'function' && define.amd ? define('@fluxhub/fluxhub-lib', ['exports', '@angular/core', '@angular/common/http', 'ngx-toastr', 'ngx-simple-crypt', 'crypto-js', 'recursive-diff', 'rxjs/operators', '@angular/forms', '@angular/material/dialog', 'ng2-file-upload', '@angular/router', 'ng2-slim-loading-bar', 'ag-grid-enterprise', '@angular/material/select', 'rxjs', '@angular/material/slide-toggle', '@angular/material/autocomplete', 'moment', '@angular/material/core', '@angular/common', 'clipboard', 'prismjs', 'prismjs/plugins/toolbar/prism-toolbar', 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard', 'prismjs/components/prism-css', 'prismjs/components/prism-javascript', 'prismjs/components/prism-java', 'prismjs/components/prism-markup', 'prismjs/components/prism-typescript', 'prismjs/components/prism-sass', 'prismjs/components/prism-scss', 'prismjs/components/prism-sql', 'bpmn-js/lib/NavigatedViewer', '@angular/material/tabs', '@angular/flex-layout', 'ngx-markdown', 'ag-grid-angular', '@agm/core', '@angular/cdk/table', 'ngforage', '@ngx-translate/core', 'ng2-dragula', '@angular/platform-browser', '@angular/material/card', '@angular/material/button', '@angular/material/checkbox', '@angular/material/button-toggle', '@angular/material/chips', '@angular/material/datepicker', '@angular/material/expansion', '@angular/material/form-field', '@angular/material/grid-list', '@angular/material/icon', '@angular/material/input', '@angular/material/list', '@angular/material/menu', '@angular/material/progress-bar', '@angular/material/progress-spinner', '@angular/material/radio', '@angular/material/slider', '@angular/material/sidenav', '@angular/material/snack-bar', '@angular/material/stepper', '@angular/material/toolbar', '@angular/material/tooltip', '@angular/material/paginator', '@angular/material/sort', '@angular/material/table', '@angular/material/badge', 'ngx-quill'], factory) :
4
- (global = global || self, factory((global.fluxhub = global.fluxhub || {}, global.fluxhub['fluxhub-lib'] = {}), global.ng.core, global.ng.common.http, global.ngxToastr, global.ngxSimpleCrypt, global.cryptoJs, global.recursiveDiff, global.rxjs.operators, global.ng.forms, global.ng.material.dialog, global.ng2FileUpload, global.ng.router, global.ng2SlimLoadingBar, null, global.ng.material.select, global.rxjs, global.ng.material['slide-toggle'], global.ng.material.autocomplete, global.momentNs, global.ng.material.core, global.ng.common, null, null, null, null, null, null, null, null, null, null, null, null, global.NavigatedViewer, global.ng.material.tabs, global.ng['flex-layout'], global.ngxMarkdown, global.agGridAngular, global.core$2, global.ng.cdk.table, global.ngforage, global.core$3, global.ng2Dragula, global.ng.platformBrowser, global.ng.material.card, global.ng.material.button, global.ng.material.checkbox, global.ng.material['button-toggle'], global.ng.material.chips, global.ng.material.datepicker, global.ng.material.expansion, global.ng.material['form-field'], global.ng.material['grid-list'], global.ng.material.icon, global.ng.material.input, global.ng.material.list, global.ng.material.menu, global.ng.material['progress-bar'], global.ng.material['progress-spinner'], global.ng.material.radio, global.ng.material.slider, global.ng.material.sidenav, global.ng.material['snack-bar'], global.ng.material.stepper, global.ng.material.toolbar, global.ng.material.tooltip, global.ng.material.paginator, global.ng.material.sort, global.ng.material.table, global.ng.material.badge, global.ngxQuill));
5
- }(this, (function (exports, core, http, ngxToastr, ngxSimpleCrypt, cryptoJs, recursiveDiff, operators, forms, dialog, ng2FileUpload, router, ng2SlimLoadingBar, agGridEnterprise, select, rxjs, slideToggle, autocomplete, momentNs, core$1, common, clipboard, prismjs, prismToolbar, prismCopyToClipboard, prismCss, prismJavascript, prismJava, prismMarkup, prismTypescript, prismSass, prismScss, prismSql, NavigatedViewer, tabs, flexLayout, ngxMarkdown, agGridAngular, core$2, table, ngforage, core$3, ng2Dragula, platformBrowser, card, button, checkbox, buttonToggle, chips, datepicker, expansion, formField, gridList, icon, input, list, menu, progressBar, progressSpinner, radio, slider, sidenav, snackBar, stepper, toolbar, tooltip, paginator, sort, table$1, badge, ngxQuill) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/material/dialog'), require('ngx-toastr'), require('@angular/core'), require('ng2-file-upload'), require('@angular/common/http'), require('ngx-simple-crypt'), require('crypto-js'), require('recursive-diff'), require('rxjs/operators'), require('@angular/forms'), require('@angular/router'), require('ng2-slim-loading-bar'), require('ag-grid-enterprise'), require('@angular/material/select'), require('rxjs'), require('@angular/material/slide-toggle'), require('@angular/material/autocomplete'), require('moment'), require('@angular/material/core'), require('@angular/common'), require('clipboard'), require('prismjs'), require('prismjs/plugins/toolbar/prism-toolbar'), require('prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard'), require('prismjs/components/prism-css'), require('prismjs/components/prism-javascript'), require('prismjs/components/prism-java'), require('prismjs/components/prism-markup'), require('prismjs/components/prism-typescript'), require('prismjs/components/prism-sass'), require('prismjs/components/prism-scss'), require('prismjs/components/prism-sql'), require('bpmn-js/lib/NavigatedViewer'), require('@angular/material/tabs'), require('@angular/flex-layout'), require('ngx-markdown'), require('ag-grid-angular'), require('@agm/core'), require('@angular/cdk/table'), require('ngforage'), require('@ngx-translate/core'), require('ng2-dragula'), require('@angular/platform-browser'), require('@angular/material/card'), require('@angular/material/button'), require('@angular/material/checkbox'), require('@angular/material/button-toggle'), require('@angular/material/chips'), require('@angular/material/datepicker'), require('@angular/material/expansion'), require('@angular/material/form-field'), require('@angular/material/grid-list'), require('@angular/material/icon'), require('@angular/material/input'), require('@angular/material/list'), require('@angular/material/menu'), require('@angular/material/progress-bar'), require('@angular/material/progress-spinner'), require('@angular/material/radio'), require('@angular/material/slider'), require('@angular/material/sidenav'), require('@angular/material/snack-bar'), require('@angular/material/stepper'), require('@angular/material/toolbar'), require('@angular/material/tooltip'), require('@angular/material/paginator'), require('@angular/material/sort'), require('@angular/material/table'), require('@angular/material/badge'), require('ngx-quill')) :
3
+ typeof define === 'function' && define.amd ? define('@fluxhub/fluxhub-lib', ['exports', '@angular/material/dialog', 'ngx-toastr', '@angular/core', 'ng2-file-upload', '@angular/common/http', 'ngx-simple-crypt', 'crypto-js', 'recursive-diff', 'rxjs/operators', '@angular/forms', '@angular/router', 'ng2-slim-loading-bar', 'ag-grid-enterprise', '@angular/material/select', 'rxjs', '@angular/material/slide-toggle', '@angular/material/autocomplete', 'moment', '@angular/material/core', '@angular/common', 'clipboard', 'prismjs', 'prismjs/plugins/toolbar/prism-toolbar', 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard', 'prismjs/components/prism-css', 'prismjs/components/prism-javascript', 'prismjs/components/prism-java', 'prismjs/components/prism-markup', 'prismjs/components/prism-typescript', 'prismjs/components/prism-sass', 'prismjs/components/prism-scss', 'prismjs/components/prism-sql', 'bpmn-js/lib/NavigatedViewer', '@angular/material/tabs', '@angular/flex-layout', 'ngx-markdown', 'ag-grid-angular', '@agm/core', '@angular/cdk/table', 'ngforage', '@ngx-translate/core', 'ng2-dragula', '@angular/platform-browser', '@angular/material/card', '@angular/material/button', '@angular/material/checkbox', '@angular/material/button-toggle', '@angular/material/chips', '@angular/material/datepicker', '@angular/material/expansion', '@angular/material/form-field', '@angular/material/grid-list', '@angular/material/icon', '@angular/material/input', '@angular/material/list', '@angular/material/menu', '@angular/material/progress-bar', '@angular/material/progress-spinner', '@angular/material/radio', '@angular/material/slider', '@angular/material/sidenav', '@angular/material/snack-bar', '@angular/material/stepper', '@angular/material/toolbar', '@angular/material/tooltip', '@angular/material/paginator', '@angular/material/sort', '@angular/material/table', '@angular/material/badge', 'ngx-quill'], factory) :
4
+ (global = global || self, factory((global.fluxhub = global.fluxhub || {}, global.fluxhub['fluxhub-lib'] = {}), global.ng.material.dialog, global.ngxToastr, global.ng.core, global.ng2FileUpload, global.ng.common.http, global.ngxSimpleCrypt, global.cryptoJs, global.recursiveDiff, global.rxjs.operators, global.ng.forms, global.ng.router, global.ng2SlimLoadingBar, null, global.ng.material.select, global.rxjs, global.ng.material['slide-toggle'], global.ng.material.autocomplete, global.momentNs, global.ng.material.core, global.ng.common, null, null, null, null, null, null, null, null, null, null, null, null, global.NavigatedViewer, global.ng.material.tabs, global.ng['flex-layout'], global.ngxMarkdown, global.agGridAngular, global.core$2, global.ng.cdk.table, global.ngforage, global.core$3, global.ng2Dragula, global.ng.platformBrowser, global.ng.material.card, global.ng.material.button, global.ng.material.checkbox, global.ng.material['button-toggle'], global.ng.material.chips, global.ng.material.datepicker, global.ng.material.expansion, global.ng.material['form-field'], global.ng.material['grid-list'], global.ng.material.icon, global.ng.material.input, global.ng.material.list, global.ng.material.menu, global.ng.material['progress-bar'], global.ng.material['progress-spinner'], global.ng.material.radio, global.ng.material.slider, global.ng.material.sidenav, global.ng.material['snack-bar'], global.ng.material.stepper, global.ng.material.toolbar, global.ng.material.tooltip, global.ng.material.paginator, global.ng.material.sort, global.ng.material.table, global.ng.material.badge, global.ngxQuill));
5
+ }(this, (function (exports, dialog, ngxToastr, core, ng2FileUpload, http, ngxSimpleCrypt, cryptoJs, recursiveDiff, operators, forms, router, ng2SlimLoadingBar, agGridEnterprise, select, rxjs, slideToggle, autocomplete, momentNs, core$1, common, clipboard, prismjs, prismToolbar, prismCopyToClipboard, prismCss, prismJavascript, prismJava, prismMarkup, prismTypescript, prismSass, prismScss, prismSql, NavigatedViewer, tabs, flexLayout, ngxMarkdown, agGridAngular, core$2, table, ngforage, core$3, ng2Dragula, platformBrowser, card, button, checkbox, buttonToggle, chips, datepicker, expansion, formField, gridList, icon, input, list, menu, progressBar, progressSpinner, radio, slider, sidenav, snackBar, stepper, toolbar, tooltip, paginator, sort, table$1, badge, ngxQuill) { 'use strict';
6
6
 
7
7
  NavigatedViewer = NavigatedViewer && NavigatedViewer.hasOwnProperty('default') ? NavigatedViewer['default'] : NavigatedViewer;
8
8
 
@@ -1004,543 +1004,465 @@
1004
1004
  return QueryService;
1005
1005
  }());
1006
1006
 
1007
- var FHPickListComponent = /** @class */ (function () {
1008
- function FHPickListComponent(dialogRef, _dataService, toastr, data) {
1009
- this.dialogRef = dialogRef;
1010
- this._dataService = _dataService;
1007
+ var OdbcService = /** @class */ (function () {
1008
+ function OdbcService(http, app_s, toastr) {
1009
+ this.http = http;
1010
+ this.app_s = app_s;
1011
1011
  this.toastr = toastr;
1012
- this.data = data;
1013
- this.width = "100%";
1014
- this.selectedAdd = null;
1015
- this.selectedRemove = null;
1016
- this.selval = "-1";
1017
- this.errorMsg = "";
1018
- this.valDef = "-1";
1019
- this.fltr_user = "";
1020
- this.value_list = new Array();
1021
- this.single_sel = false;
1022
- this.vis_buttons = true;
1023
- this.limit_size = false;
1024
- this.value_list_sel = new Array();
1012
+ this.url = this.app_s.API_ENDPOINT + this.app_s.ODBC_ENDPOINT; // URL to web API
1013
+ }
1014
+ OdbcService.prototype.doQuery = function (queryp, displayError) {
1015
+ var _this = this;
1016
+ if (displayError === void 0) { displayError = true; }
1017
+ this.headers = new http.HttpHeaders({
1018
+ "Content-Type": "application/json",
1019
+ Authorization: "Bearer " + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
1020
+ });
1021
+ this.url = this.app_s.API_ENDPOINT + this.app_s.ODBC_ENDPOINT;
1022
+ var post_v = JSON.stringify(queryp);
1023
+ return this.http.post(this.url, post_v, { headers: this.headers }).pipe(operators.map(function (res) {
1024
+ // Handle errors, display if enabled
1025
+ var err;
1026
+ if (!res) {
1027
+ err = new Error("Empty server response");
1028
+ }
1029
+ else if (res.result_msg === "KO") {
1030
+ err = new Error(res.msg);
1031
+ }
1032
+ if (err) {
1033
+ console.error(err);
1034
+ if (displayError) {
1035
+ _this.toastr.error(err.message);
1036
+ }
1037
+ throw new Error(err);
1038
+ }
1039
+ return res || new QGResult();
1040
+ }), operators.catchError(function (err) {
1041
+ // In a real world app, we might use a remote logging infrastructure
1042
+ // We'd also dig deeper into the error to get a better message
1043
+ var errMsg = err.message
1044
+ ? err.message
1045
+ : err.status
1046
+ ? err.status + " - " + err.statusText
1047
+ : "Server error";
1048
+ console.error(errMsg); // log to console instead
1049
+ throw err;
1050
+ }));
1051
+ };
1052
+ OdbcService.ctorParameters = function () { return [
1053
+ { type: http.HttpClient },
1054
+ { type: AppService },
1055
+ { type: ngxToastr.ToastrService }
1056
+ ]; };
1057
+ OdbcService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function OdbcService_Factory() { return new OdbcService(core["ɵɵinject"](http.HttpClient), core["ɵɵinject"](AppService), core["ɵɵinject"](ngxToastr.ToastrService)); }, token: OdbcService, providedIn: "root" });
1058
+ OdbcService = __decorate([
1059
+ core.Injectable({
1060
+ providedIn: "root",
1061
+ }),
1062
+ __metadata("design:paramtypes", [http.HttpClient,
1063
+ AppService,
1064
+ ngxToastr.ToastrService])
1065
+ ], OdbcService);
1066
+ return OdbcService;
1067
+ }());
1068
+
1069
+ var noop = function () { };
1070
+ var ɵ0 = noop;
1071
+ var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
1072
+ provide: forms.NG_VALUE_ACCESSOR,
1073
+ useExisting: core.forwardRef(function () { return FHComboboxComponent; }),
1074
+ multi: true,
1075
+ };
1076
+ var FHComboboxComponent = /** @class */ (function () {
1077
+ function FHComboboxComponent(_dataService, _dataService_odbc) {
1078
+ this._dataService = _dataService;
1079
+ this._dataService_odbc = _dataService_odbc;
1080
+ this.init_fill = true;
1081
+ this.sql = "";
1025
1082
  this.types = [];
1026
1083
  this.values = [];
1027
- this.value_sel = [];
1028
- if (data != null) {
1029
- if (data.value_list != null)
1030
- this.value_list = data.value_list;
1031
- if (data.single_sel != null)
1032
- this.single_sel = data.single_sel;
1033
- if (data.vis_buttons != null)
1034
- this.vis_buttons = data.vis_buttons;
1035
- if (data.limit_size != null)
1036
- this.limit_size = data.limit_size;
1037
- if (data.value_sel != null)
1038
- this.value_sel = data.value_sel;
1039
- this.fill_list_arr(this.value_list, this.value_sel);
1040
- }
1084
+ this.hidden = false;
1085
+ this.label = "";
1086
+ this.enabled = true;
1087
+ this.required = false;
1088
+ this.sel_label = "";
1089
+ this.fillend = new core.EventEmitter();
1090
+ this.selchange = new core.EventEmitter();
1091
+ this.initend = new core.EventEmitter();
1092
+ this.myData = [];
1093
+ this.valDef = "-1";
1094
+ this.selval = "-1";
1095
+ this.errorMsg = "";
1096
+ this.db_type = "1";
1097
+ this.dis_value = "";
1098
+ this.descri_val = "";
1099
+ this.onChange = function (_) { };
1100
+ this.onTouched = function () { };
1041
1101
  }
1042
- FHPickListComponent.prototype.ngAfterViewInit = function () { };
1043
- FHPickListComponent.prototype.filtra = function () {
1044
- this.value_list_sel = new Array();
1045
- // console.log('filtra() '+this.fltr_user.toUpperCase());
1046
- if (this.fltr_user == "") {
1047
- for (var i = 0; i < this.value_list.length; i++) {
1048
- this.value_list_sel.push(this.value_list[i]);
1049
- if (i == 50 && this.limit_size)
1102
+ FHComboboxComponent.prototype.setValue = function (desc_val) {
1103
+ this.setByValue(desc_val);
1104
+ };
1105
+ FHComboboxComponent.prototype.update_dis = function () {
1106
+ this.dis_value = "";
1107
+ try {
1108
+ if (this.descri_val != null)
1109
+ if (this.descri_val != "") {
1110
+ this.dis_value = this.descri_val;
1050
1111
  return;
1051
- }
1052
- }
1053
- else {
1054
- for (var i = 0; i < this.value_list.length; i++)
1055
- if (this.value_list[i].descrizione_valore
1056
- .toUpperCase()
1057
- .indexOf(this.fltr_user.toUpperCase()) != -1) {
1058
- var b_found_a = false;
1059
- for (var z = 0; z < this.value_list_sel.length; z++)
1060
- if (this.value_list_sel[z].descrizione_valore ==
1061
- this.value_list[i].descrizione_valore) {
1062
- b_found_a = true;
1063
- break;
1064
- }
1065
- if (!b_found_a)
1066
- this.value_list_sel.push(this.value_list[i]);
1067
- if (this.value_list_sel.length == 50 && this.limit_size)
1068
- return;
1069
1112
  }
1113
+ if (this.valDef == null)
1114
+ this.dis_value = "";
1115
+ else
1116
+ this.dis_value = this.valDef.split("-1").join("");
1117
+ }
1118
+ catch (e) {
1119
+ console.log("errore split -> this.valDef ", this.valDef);
1070
1120
  }
1071
- /*
1072
- this.value_list_sel =new Array();
1073
- for(let i:number=0;i<this.value_list.length;i++)
1074
- {
1075
- let b_found_a=false;
1076
- for(let z:number=0;z<this.value_list_sel.length;z++)
1077
- if(this.value_list_sel[z].descrizione_valore==this.value_list[i].descrizione_valore){b_found_a=true; break;}
1078
-
1079
- if(!b_found_a && (this.value_list[i].descrizione_valore.toUpperCase().indexOf(this.fltr_user.toUpperCase())!=-1 || this.fltr_user==''))
1080
- {
1081
- // console.log(this.value_list[i].username);
1082
- if(this.value_sel==null) this.value_list_sel.push(this.value_list[i]);
1083
- else
1084
- {
1085
-
1086
- let b_found=false;
1087
- for(let y:number=0;y<this.value_sel.length;y++)
1088
- if(this.value_sel[y].descrizione_valore==this.value_list[i].descrizione_valore){b_found=true; break;}
1089
- if(!b_found)
1090
- this.value_list_sel.push(this.value_list[i]);
1091
- }
1092
- }
1093
- }*/
1094
- // console.log(this.value_list);
1095
1121
  };
1096
- FHPickListComponent.prototype.fill_list = function (k, arrs) {
1122
+ FHComboboxComponent.prototype.resetValue = function () {
1123
+ this.selval = "-1";
1124
+ this.valDef = "-1";
1125
+ this.update_dis();
1126
+ };
1127
+ FHComboboxComponent.prototype.focus = function () {
1128
+ this.smtr.nativeElement.focus();
1129
+ };
1130
+ FHComboboxComponent.prototype.reset = function () {
1131
+ console.log("reset");
1132
+ this.selval = "-1";
1133
+ this.valDef = "-1";
1134
+ this.myData = new Array();
1135
+ this.update_dis();
1136
+ };
1137
+ FHComboboxComponent.prototype.fillCombo = function () {
1097
1138
  var _this = this;
1098
- this.value_sel = new Array();
1099
- for (var i = 0; i < arrs.length; i++) {
1100
- var o = new Object();
1101
- o.descrizione_valore = arrs[i];
1102
- this.value_sel.push(o);
1139
+ // console.log(this.init_fill);
1140
+ // if(!this.init_fill){this.init_fill=true;return;}
1141
+ if (this.sql == null)
1142
+ this.sql = "";
1143
+ if (this.sql.indexOf("|") != -1 && this.sql.indexOf("$") != -1) {
1144
+ this.set_options(this.sql);
1145
+ return;
1103
1146
  }
1104
- var ok_op = false;
1105
1147
  var p = new QParam();
1106
- p.sql = k;
1148
+ p.sql = this.sql;
1107
1149
  p.types = this.types;
1108
1150
  p.values = this.values;
1109
- this._dataService.doQuery(p).subscribe(function (data) {
1110
- var ok_op = false;
1111
- if (data != null)
1112
- if (data.result_msg == "OK") {
1113
- _this.value_list = data.result_data;
1114
- for (var y = 0; y < _this.value_sel.length; y++)
1115
- for (var i_1 = _this.value_list.length - 1; i_1 >= 0; i_1--)
1116
- if (_this.value_list[i_1].descrizione_valore ==
1117
- _this.value_sel[y].descrizione_valore) {
1118
- _this.value_list.splice(i_1, 1);
1119
- break;
1120
- }
1121
- _this.filtra();
1122
- ok_op = true;
1123
- }
1124
- if (!ok_op) {
1125
- }
1126
- }, function (err) {
1127
- _this.errorMsg =
1128
- "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI";
1129
- });
1130
- };
1131
- FHPickListComponent.prototype.fill_list_arr = function (k, arrs) {
1132
- this.value_sel = new Array();
1133
- for (var i = 0; i < arrs.length; i++)
1134
- for (var y = 0; y < k.length; y++)
1135
- if (arrs[i] ==
1136
- k[y].descrizione_valore) {
1137
- this.value_sel.push(k[y]);
1151
+ var ok_op = false;
1152
+ // console.log(p);
1153
+ if (this.db_type == "1")
1154
+ this._dataService.doQuery(p).subscribe(function (data) {
1155
+ var ok_op = false;
1156
+ if (data != null)
1157
+ if (data.result_msg == "OK") {
1158
+ _this.resetD(data.result_data);
1159
+ ok_op = true;
1160
+ }
1161
+ if (!ok_op) {
1138
1162
  }
1139
- this.value_list = k;
1140
- for (var y = 0; y < this.value_sel.length; y++)
1141
- for (var i = this.value_list.length - 1; i >= 0; i--)
1142
- if (this.value_list[i].descrizione_valore ==
1143
- this.value_sel[y].descrizione_valore) {
1144
- this.value_list.splice(i, 1);
1145
- break;
1163
+ }, function (err) {
1164
+ _this.errorMsg =
1165
+ "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" +
1166
+ _this.sql +
1167
+ "]";
1168
+ });
1169
+ if (this.db_type == "2")
1170
+ this._dataService_odbc.doQuery(p).subscribe(function (data) {
1171
+ var ok_op = false;
1172
+ if (data != null)
1173
+ if (data.result_msg == "OK") {
1174
+ for (var i = 0; i < data.result_data.length; i++) {
1175
+ if (data.result_data[i].VALORE != null)
1176
+ data.result_data[i].valore = data.result_data[i].VALORE;
1177
+ if (data.result_data[i].DESCRIZIONE_VALORE != null)
1178
+ data.result_data[i].descrizione_valore =
1179
+ data.result_data[i].DESCRIZIONE_VALORE;
1180
+ }
1181
+ _this.resetD(data.result_data);
1182
+ ok_op = true;
1183
+ }
1184
+ if (!ok_op) {
1146
1185
  }
1147
- this.filtra();
1148
- };
1149
- FHPickListComponent.prototype.do_add = function () {
1150
- if (this.selectedAdd == null) {
1151
- this.toastr.error("ERRORE", "Selezionare il valore da aggiungere", {
1152
- timeOut: 1000,
1153
- progressBar: true,
1186
+ }, function (err) {
1187
+ _this.errorMsg =
1188
+ "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" +
1189
+ _this.sql +
1190
+ "]";
1154
1191
  });
1192
+ };
1193
+ FHComboboxComponent.prototype.add_option = function (o) {
1194
+ this.myData.push(o);
1195
+ };
1196
+ FHComboboxComponent.prototype.resetD = function (o) {
1197
+ this.myData = o;
1198
+ this.selval = "-1";
1199
+ // console.log(this.smtr); console.log(this.smtr.nativeElement);
1200
+ this.setByValue(this.valDef);
1201
+ if (this.getValue() == "-1" && this.valDef != "-1")
1202
+ this.setByDescri(this.valDef);
1203
+ this.fillend.emit();
1204
+ };
1205
+ FHComboboxComponent.prototype.setByDescri = function (desc_val) {
1206
+ // console.log("setByDescri "+desc_val);
1207
+ this.valDef = desc_val;
1208
+ this.selval = "-1";
1209
+ if (desc_val == "")
1155
1210
  return;
1156
- }
1157
- var index = this.value_list.indexOf(this.selectedAdd, 0);
1158
- if (!this.single_sel)
1159
- if (index > -1) {
1160
- this.value_list.splice(index, 1);
1211
+ if (this.myData == null)
1212
+ return;
1213
+ if (this.myData.length == 0 || this.myData[0] == null)
1214
+ return;
1215
+ for (var j = 0; j < this.myData.length; j++)
1216
+ if (this.myData[j].descrizione_valore == desc_val) {
1217
+ this.selval = "" + this.myData[j].valore;
1218
+ if (this.myData[j].descrizione_valore != null)
1219
+ this.descri_val = this.myData[j].descrizione_valore;
1220
+ this.update_dis();
1221
+ return;
1161
1222
  }
1162
- if (this.single_sel)
1163
- this.value_sel = new Array();
1164
- this.value_sel.push(this.selectedAdd);
1165
- this.selectedAdd = null;
1166
- this.filtra();
1167
- if (this.single_sel)
1168
- this.ok();
1223
+ this.update_dis();
1169
1224
  };
1170
- FHPickListComponent.prototype.do_rem = function () {
1171
- if (this.selectedRemove == null) {
1172
- this.toastr.error("ERRORE", "Selezionare il valore da rimuovere", {
1173
- timeOut: 1000,
1174
- progressBar: true,
1175
- });
1225
+ FHComboboxComponent.prototype.setByIndex = function (ind) {
1226
+ this.valDef = "";
1227
+ this.selval = "-1";
1228
+ if (this.myData == null)
1176
1229
  return;
1230
+ if (this.myData.length == 0 || this.myData[0] == null)
1231
+ return;
1232
+ if (this.myData.length > ind) {
1233
+ this.setByDescri(this.myData[ind].descrizione_valore);
1177
1234
  }
1178
- var index = this.value_sel.indexOf(this.selectedRemove, 0);
1179
- if (index > -1) {
1180
- this.value_sel.splice(index, 1);
1235
+ };
1236
+ FHComboboxComponent.prototype.getObj = function () {
1237
+ if (this.selval == null)
1238
+ return null;
1239
+ if (this.selval == "-1")
1240
+ return null;
1241
+ else
1242
+ for (var j = 0; j < this.myData.length; j++)
1243
+ if (this.myData[j].valore == this.selval) {
1244
+ return this.myData[j];
1245
+ }
1246
+ };
1247
+ FHComboboxComponent.prototype.setByValue = function (desc_val) {
1248
+ this.valDef = desc_val;
1249
+ this.selval = "-1";
1250
+ // console.log(this.myData);
1251
+ if ("" + desc_val == "") {
1252
+ // console.log('qqq1111');
1253
+ return;
1181
1254
  }
1182
- this.value_list.push(this.selectedRemove);
1183
- this.selectedRemove = null;
1184
- this.filtra();
1255
+ // console.log("qui");
1256
+ if (this.myData == null)
1257
+ return;
1258
+ // console.log("qui1");
1259
+ if (this.myData.length == 0 || this.myData[0] == null)
1260
+ return;
1261
+ //console.log("qui2");
1262
+ for (var j = 0; j < this.myData.length; j++) {
1263
+ //console.log(this.myData[j].valore +' '+ desc_val);
1264
+ if (this.myData[j].valore == desc_val) {
1265
+ this.selval = "" + this.myData[j].valore;
1266
+ if (this.myData[j].descrizione_valore != null)
1267
+ this.descri_val = this.myData[j].descrizione_valore;
1268
+ this.update_dis();
1269
+ return;
1270
+ }
1271
+ }
1272
+ this.update_dis();
1185
1273
  };
1186
- FHPickListComponent.prototype.addTo = function (item) {
1187
- this.option = true;
1188
- this.selectedAdd = item;
1189
- this.selectedRemove = null;
1274
+ FHComboboxComponent.prototype.getDescri = function () {
1275
+ if (!this.enabled) {
1276
+ if (this.selval == null)
1277
+ return this.valDef;
1278
+ if (this.selval == "-1")
1279
+ return this.valDef;
1280
+ }
1281
+ if (this.selval == null)
1282
+ return "-1";
1283
+ if (this.selval == "-1")
1284
+ return "-1";
1285
+ else
1286
+ for (var j = 0; j < this.myData.length; j++)
1287
+ if (this.myData[j].valore == this.selval) {
1288
+ return this.myData[j].descrizione_valore;
1289
+ }
1190
1290
  };
1191
- FHPickListComponent.prototype.removeTo = function (item) {
1192
- this.option = false;
1193
- this.selectedAdd = null;
1194
- this.selectedRemove = item;
1291
+ FHComboboxComponent.prototype.getValue = function () {
1292
+ // console.log(this.selval);
1293
+ if (!this.enabled) {
1294
+ if (this.selval == null)
1295
+ return this.valDef;
1296
+ if (this.selval == "-1")
1297
+ return this.valDef;
1298
+ }
1299
+ if (this.selval == null)
1300
+ return "-1";
1301
+ if (this.selval == "")
1302
+ return "-1";
1303
+ else
1304
+ return this.selval;
1195
1305
  };
1196
- FHPickListComponent.prototype.getSelStr = function () {
1197
- var sx = "";
1198
- for (var i = 0; i < this.value_sel.length; i++) {
1199
- if (sx != "")
1200
- sx = sx + ",";
1201
- sx = sx + this.value_sel[i].descrizione_valore;
1306
+ FHComboboxComponent.prototype.getData = function (campo) {
1307
+ for (var x in this.myData) {
1308
+ if (this.myData[x]["valore"] == this.selval) {
1309
+ return this.myData[x][campo];
1310
+ }
1311
+ else {
1312
+ continue;
1313
+ }
1202
1314
  }
1203
- return sx;
1204
1315
  };
1205
- FHPickListComponent.prototype.getSelArr = function () {
1206
- return this.value_sel;
1316
+ FHComboboxComponent.prototype.set_options = function (s) {
1317
+ this.myData = new Array();
1318
+ var a = s.split("$");
1319
+ for (var i = 0; i < a.length; i++) {
1320
+ var o = new Object();
1321
+ var av = a[i].split("|");
1322
+ o.valore = av[1];
1323
+ o.descrizione_valore = av[0];
1324
+ this.myData.push(o);
1325
+ }
1326
+ this.setByValue(this.valDef);
1327
+ if (this.getValue() == "-1")
1328
+ this.setByDescri(this.valDef);
1207
1329
  };
1208
- FHPickListComponent.prototype.ok = function () {
1209
- this.dialogRef.close(this.getSelArr());
1330
+ FHComboboxComponent.prototype.ngAfterViewInit = function () {
1331
+ var _this = this;
1332
+ setTimeout(function () {
1333
+ if (_this.init_fill == true) {
1334
+ if (_this.sql == "") {
1335
+ //this.errorMsg="QUERY NON CONFIGURATA";
1336
+ return;
1337
+ }
1338
+ _this.fillCombo();
1339
+ }
1340
+ else {
1341
+ _this.errorMsg = "";
1342
+ }
1343
+ _this.initend.emit();
1344
+ });
1210
1345
  };
1211
- FHPickListComponent.ctorParameters = function () { return [
1212
- { type: dialog.MatDialogRef },
1346
+ FHComboboxComponent.prototype.sc = function () {
1347
+ this.onChange(this.getValue());
1348
+ this.selchange.emit({
1349
+ event: this.getObj(),
1350
+ valore: this.getValue(),
1351
+ descrizione_valore: this.getDescri(),
1352
+ });
1353
+ };
1354
+ FHComboboxComponent.prototype.getModelValue = function () {
1355
+ var value = this.getData("valore");
1356
+ return value;
1357
+ };
1358
+ FHComboboxComponent.prototype.writeValue = function (value) {
1359
+ this.setByValue(value);
1360
+ };
1361
+ FHComboboxComponent.prototype.registerOnChange = function (fn) {
1362
+ this.onChange = fn;
1363
+ };
1364
+ FHComboboxComponent.prototype.registerOnTouched = function (fn) {
1365
+ this.onTouched = fn;
1366
+ };
1367
+ FHComboboxComponent.ctorParameters = function () { return [
1213
1368
  { type: QueryService },
1214
- { type: ngxToastr.ToastrService },
1215
- { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
1369
+ { type: OdbcService }
1216
1370
  ]; };
1217
1371
  __decorate([
1218
1372
  core.Input(),
1219
- __metadata("design:type", Array)
1220
- ], FHPickListComponent.prototype, "value_list", void 0);
1373
+ __metadata("design:type", Boolean)
1374
+ ], FHComboboxComponent.prototype, "init_fill", void 0);
1221
1375
  __decorate([
1222
1376
  core.Input(),
1223
- __metadata("design:type", Boolean)
1224
- ], FHPickListComponent.prototype, "single_sel", void 0);
1377
+ __metadata("design:type", String)
1378
+ ], FHComboboxComponent.prototype, "sql", void 0);
1225
1379
  __decorate([
1226
1380
  core.Input(),
1227
- __metadata("design:type", Boolean)
1228
- ], FHPickListComponent.prototype, "vis_buttons", void 0);
1229
- __decorate([
1230
- core.Input(),
1231
- __metadata("design:type", Boolean)
1232
- ], FHPickListComponent.prototype, "limit_size", void 0);
1381
+ __metadata("design:type", Array)
1382
+ ], FHComboboxComponent.prototype, "types", void 0);
1233
1383
  __decorate([
1234
1384
  core.Input(),
1235
1385
  __metadata("design:type", Array)
1236
- ], FHPickListComponent.prototype, "value_sel", void 0);
1237
- FHPickListComponent = __decorate([
1238
- core.Component({
1239
- selector: "FHPickList",
1240
- template: "\n <div fxLayout=\"column\" fxLayoutGap=\"15px\" fxFlex>\n <div fxLayout=\"row\">\n <div fxLayout=\"column\" fxFlex=\"41%\">\n <div style=\"width:100%;height:420px;overflow:auto;\">\n <table style=\"width: 100%\" class=\"fh_table\">\n <thead>\n <tr>\n <th>VALORI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr>\n <td>\n <input\n [(ngModel)]=\"fltr_user\"\n (ngModelChange)=\"filtra()\"\n style=\"padding:8px;margin:15px auto;width:100%;\"\n placeholder=\"Ricerca...\"\n />\n </td>\n </tr>\n <tr\n *ngFor=\"\n let u of value_list_sel;\n let odd = odd;\n let even = even\n \"\n [ngClass]=\"{ odd: odd, even: even }\"\n (click)=\"addTo(u)\"\n (dblclick)=\"do_add()\"\n class=\"selector\"\n [ngClass]=\"{ active: selectedAdd == u }\"\n >\n <td>{{ u.descrizione_valore }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div\n fxLayout=\"column\"\n fxFlex=\"18%\"\n style=\"height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);\"\n >\n <div\n style=\"position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);\"\n >\n <button\n mat-flat-button\n color=\"primary\"\n (click)=\"do_add()\"\n [disabled]=\"!option\"\n >\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br /><br />\n <button\n mat-flat-button\n color=\"primary\"\n (click)=\"do_rem()\"\n [disabled]=\"option\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout=\"column\" fxFlex=\"41%\">\n <div style=\"width:100%;height:420px;overflow:auto;\">\n <table style=\"width: 100%\" class=\"fh_table\">\n <thead>\n <tr>\n <th>VALORI SELEZIONATI</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let u of value_sel; let odd = odd; let even = even\"\n (mouseover)=\"selectedRemove = u\"\n [ngClass]=\"{ odd: odd, even: even }\"\n (click)=\"removeTo(u)\"\n (dblclick)=\"do_rem()\"\n class=\"selector\"\n [ngClass]=\"{ active: selectedRemove == u }\"\n >\n <td>{{ u.descrizione_valore }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <br /><br />\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"5px\">\n <button mat-flat-button color=\"primary\" (click)=\"ok()\">Ok</button\n >&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style=\"background-color: #F5F5F5\"\n (click)=\"dialogRef.close()\"\n >\n Annulla\n </button>\n </div>\n </div>\n ",
1241
- styles: ["\n .selector {\n cursor: hand;\n }\n "]
1242
- }),
1243
- __param(3, core.Inject(dialog.MAT_DIALOG_DATA)),
1244
- __metadata("design:paramtypes", [dialog.MatDialogRef,
1245
- QueryService,
1246
- ngxToastr.ToastrService, Object])
1247
- ], FHPickListComponent);
1248
- return FHPickListComponent;
1249
- }());
1250
-
1251
- var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
1252
- provide: forms.NG_VALUE_ACCESSOR,
1253
- useExisting: core.forwardRef(function () { return FHPickFieldComponent; }),
1254
- multi: true,
1255
- };
1256
- var FHPickFieldComponent = /** @class */ (function () {
1257
- function FHPickFieldComponent(dataservice, dialog) {
1258
- this.dataservice = dataservice;
1259
- this.dialog = dialog;
1260
- this.label = '';
1261
- this.required = false;
1262
- this.enabled = true;
1263
- this.hidden = false;
1264
- this.sep = ',';
1265
- this.value_list = new Array();
1266
- this.single_sel = false;
1267
- this.vis_buttons = true;
1268
- this.limit_size = false;
1269
- this.value_sel = new Array();
1270
- this.change = new core.EventEmitter();
1271
- this.t_value = "";
1272
- this.i_value = "";
1273
- this.selectedUser = [];
1274
- this.onChange = function (_) { };
1275
- this.onTouched = function () { };
1276
- }
1277
- FHPickFieldComponent.prototype.ngAfterViewInit = function () {
1278
- var _this = this;
1279
- setTimeout(function () {
1280
- if (_this.required)
1281
- _this.label = _this.label + " *";
1282
- });
1283
- };
1284
- FHPickFieldComponent.prototype.set_by_value = function (v) {
1285
- if (v == null)
1286
- this.clear();
1287
- if (v == '')
1288
- this.clear();
1289
- var vx = v.split(this.sep);
1290
- this.t_value = '';
1291
- this.i_value = '';
1292
- for (var ix = 0; ix < vx.length; ix++) {
1293
- for (var index = 0; index < this.value_list.length; index++) {
1294
- if (vx[ix] == this.value_list[index].valore) {
1295
- if (this.t_value != '')
1296
- this.t_value += this.sep;
1297
- this.t_value += this.value_list[index].descrizione_valore;
1298
- if (this.i_value != '')
1299
- this.i_value += this.sep;
1300
- this.i_value += this.value_list[index].descrizione_valore;
1301
- break;
1302
- }
1303
- }
1304
- }
1305
- };
1306
- FHPickFieldComponent.prototype.writeValue = function (value) {
1307
- if (value == null) {
1308
- this.clear();
1309
- return;
1310
- }
1311
- if (value == '') {
1312
- this.clear();
1313
- return;
1314
- }
1315
- this.set_by_value(value);
1316
- };
1317
- FHPickFieldComponent.prototype.open_pick = function () {
1318
- var _this = this;
1319
- if (!this.enabled)
1320
- return;
1321
- var dialogRef = this.dialog.open(FHPickListComponent, {
1322
- disableClose: true,
1323
- width: "700px",
1324
- height: "550px", data: {
1325
- value_list: this.value_list,
1326
- single_sel: this.single_sel,
1327
- vis_buttons: this.vis_buttons,
1328
- limit_size: this.limit_size,
1329
- value_sel: this.value_sel
1330
- }
1331
- });
1332
- dialogRef.afterClosed().subscribe(function (result) {
1333
- if (result != null) {
1334
- _this.set_by_value(result.map(function (v) { return v.valore; }).join(_this.sep));
1335
- _this.change.emit(result);
1336
- }
1337
- });
1338
- };
1339
- FHPickFieldComponent.prototype.clear = function () {
1340
- this.t_value = '';
1341
- this.i_value = '';
1342
- this.onChange('');
1343
- };
1344
- FHPickFieldComponent.prototype.registerOnChange = function (fn) {
1345
- this.onChange = fn;
1346
- };
1347
- FHPickFieldComponent.prototype.registerOnTouched = function (fn) {
1348
- this.onTouched = fn;
1349
- };
1350
- FHPickFieldComponent.ctorParameters = function () { return [
1351
- { type: QueryService },
1352
- { type: dialog.MatDialog }
1353
- ]; };
1386
+ ], FHComboboxComponent.prototype, "values", void 0);
1354
1387
  __decorate([
1355
1388
  core.Input(),
1356
- __metadata("design:type", String)
1357
- ], FHPickFieldComponent.prototype, "label", void 0);
1389
+ __metadata("design:type", Boolean)
1390
+ ], FHComboboxComponent.prototype, "hidden", void 0);
1358
1391
  __decorate([
1359
1392
  core.Input(),
1360
- __metadata("design:type", Boolean)
1361
- ], FHPickFieldComponent.prototype, "required", void 0);
1393
+ __metadata("design:type", String)
1394
+ ], FHComboboxComponent.prototype, "label", void 0);
1362
1395
  __decorate([
1363
1396
  core.Input(),
1364
1397
  __metadata("design:type", Boolean)
1365
- ], FHPickFieldComponent.prototype, "enabled", void 0);
1398
+ ], FHComboboxComponent.prototype, "enabled", void 0);
1366
1399
  __decorate([
1367
1400
  core.Input(),
1368
1401
  __metadata("design:type", Boolean)
1369
- ], FHPickFieldComponent.prototype, "hidden", void 0);
1402
+ ], FHComboboxComponent.prototype, "required", void 0);
1370
1403
  __decorate([
1371
1404
  core.Input(),
1372
1405
  __metadata("design:type", String)
1373
- ], FHPickFieldComponent.prototype, "sep", void 0);
1406
+ ], FHComboboxComponent.prototype, "sel_label", void 0);
1374
1407
  __decorate([
1375
- core.Input(),
1376
- __metadata("design:type", Array)
1377
- ], FHPickFieldComponent.prototype, "value_list", void 0);
1408
+ core.ViewChild("cmb"),
1409
+ __metadata("design:type", core.ElementRef)
1410
+ ], FHComboboxComponent.prototype, "smtr", void 0);
1378
1411
  __decorate([
1379
- core.Input(),
1380
- __metadata("design:type", Boolean)
1381
- ], FHPickFieldComponent.prototype, "single_sel", void 0);
1412
+ core.Output(),
1413
+ __metadata("design:type", core.EventEmitter)
1414
+ ], FHComboboxComponent.prototype, "fillend", void 0);
1382
1415
  __decorate([
1383
- core.Input(),
1384
- __metadata("design:type", Boolean)
1385
- ], FHPickFieldComponent.prototype, "vis_buttons", void 0);
1416
+ core.Output(),
1417
+ __metadata("design:type", core.EventEmitter)
1418
+ ], FHComboboxComponent.prototype, "selchange", void 0);
1386
1419
  __decorate([
1387
- core.Input(),
1388
- __metadata("design:type", Boolean)
1389
- ], FHPickFieldComponent.prototype, "limit_size", void 0);
1420
+ core.Output(),
1421
+ __metadata("design:type", core.EventEmitter)
1422
+ ], FHComboboxComponent.prototype, "initend", void 0);
1390
1423
  __decorate([
1391
1424
  core.Input(),
1392
- __metadata("design:type", Array)
1393
- ], FHPickFieldComponent.prototype, "value_sel", void 0);
1425
+ __metadata("design:type", String)
1426
+ ], FHComboboxComponent.prototype, "valDef", void 0);
1394
1427
  __decorate([
1395
- core.Output(),
1396
- __metadata("design:type", core.EventEmitter)
1397
- ], FHPickFieldComponent.prototype, "change", void 0);
1398
- FHPickFieldComponent = __decorate([
1428
+ core.Input(),
1429
+ __metadata("design:type", String)
1430
+ ], FHComboboxComponent.prototype, "db_type", void 0);
1431
+ FHComboboxComponent = __decorate([
1399
1432
  core.Component({
1400
- selector: "FHPickField",
1433
+ selector: "FHComboBox",
1401
1434
  providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR],
1402
- template: "\n <div fxLayout=\"row\" [hidden]=\"!enabled || hidden\">\n <mat-form-field\n style=\"clickable-field\"\n (click)=\"open_pick()\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n\n <input\n matInput\n [hidden]=\"hidden\"\n type=\"text\"\n [ngModel]=\"t_value\"\n [disabled]=\"false\"\n readonly\n />\n </mat-form-field>\n <button\n mat-icon-button\n matSuffix\n [hidden]=\"selectedUser.length == 0\"\n (click)=\"clear()\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n <mat-form-field\n [hidden]=\"enabled || hidden\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n <input\n type=\"text\"\n #el1\n matInput\n [disabled]=\"true\"\n [(ngModel)]=\"t_value\"\n />\n </mat-form-field>\n ",
1403
- styles: ["\n .clickable-field {\n border: 1px solid #000000;\n color: #000000;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]
1435
+ template: "\n <mat-form-field\n [hidden]=\"!enabled || hidden\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n <mat-select\n #cmb\n [(ngModel)]=\"selval\"\n (selectionChange)=\"sc()\"\n [required]=\"required\"\n >\n <mat-option value=\"-1\">{{ sel_label }}</mat-option>\n <mat-option value=\"{{ app.valore }}\" *ngFor=\"let app of myData\">{{\n app.descrizione_valore\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field\n [hidden]=\"enabled || hidden\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n <input\n type=\"text\"\n #el1\n matInput\n [disabled]=\"true\"\n [(ngModel)]=\"dis_value\"\n />\n </mat-form-field>\n ",
1436
+ styles: [""]
1404
1437
  }),
1405
- __metadata("design:paramtypes", [QueryService, dialog.MatDialog])
1406
- ], FHPickFieldComponent);
1407
- return FHPickFieldComponent;
1438
+ __metadata("design:paramtypes", [QueryService,
1439
+ OdbcService])
1440
+ ], FHComboboxComponent);
1441
+ return FHComboboxComponent;
1408
1442
  }());
1409
1443
 
1410
- var win_show_log_dett = /** @class */ (function () {
1411
- function win_show_log_dett(dialogRef, data) {
1412
- this.dialogRef = dialogRef;
1413
- this.data = data;
1414
- this.modifiche = [];
1415
- this.title = "";
1416
- this.title = data.title.toUpperCase();
1417
- this.modifiche = JSON.parse(data.dt);
1444
+ var FHListComponent = /** @class */ (function () {
1445
+ function FHListComponent(_dataService) {
1446
+ this._dataService = _dataService;
1447
+ this.init_fill = true;
1448
+ this.sql = "";
1449
+ this.types = [];
1450
+ this.values = [];
1451
+ this.label = "";
1452
+ this.enabled = true;
1453
+ this.single_sel = false;
1454
+ this.separator = ",";
1455
+ this.fillend = new core.EventEmitter();
1456
+ this.selchange = new core.EventEmitter();
1457
+ this.initend = new core.EventEmitter();
1458
+ this.myData = new Array();
1459
+ this.selval = "-1";
1460
+ this.errorMsg = "";
1461
+ this.valDef = "-1";
1418
1462
  }
1419
- win_show_log_dett.prototype.close = function () {
1420
- this.dialogRef.close(null);
1421
- };
1422
- win_show_log_dett.prototype.ngAfterViewInit = function () { };
1423
- win_show_log_dett.ctorParameters = function () { return [
1424
- { type: dialog.MatDialogRef },
1425
- { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
1426
- ]; };
1427
- win_show_log_dett = __decorate([
1428
- core.Component({
1429
- template: "\n <div style=\"width:100%\" fxLayout=\"row\" fxLayoutAlign=\"end start\">\n <img\n src=\"assets/icons/x.png\"\n style=\"cursor: pointer;\"\n (click)=\"close()\"\n />\n </div>\n <hr width=\"100%\" size=\"0.5\" color=\"#DDDDDD\" />\n <h2 mat-dialog-title>DETTAGLIO MODIFICA - {{ title }}</h2>\n\n <mat-dialog-content style=\"min-width:700px\">\n <table style=\"width: 90%\" class=\"fh_table\">\n <thead>\n <tr>\n <th style=\"width:20%;\">Operazione</th>\n <th style=\"width:20%;\">Campo</th>\n <th style=\"width:30%;\">Old Value</th>\n <th style=\"width:30%;\">New Value</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let u of modifiche; let odd = odd; let even = even\"\n [ngClass]=\"{ odd: odd, even: even }\"\n >\n <td>{{ u.op }}</td>\n <td>{{ u.path }}</td>\n <td>{{ u.oldVal }}</td>\n <td>{{ u.val }}</td>\n </tr>\n </tbody>\n </table>\n </mat-dialog-content>\n "
1430
- }),
1431
- __param(1, core.Inject(dialog.MAT_DIALOG_DATA)),
1432
- __metadata("design:paramtypes", [dialog.MatDialogRef, Object])
1433
- ], win_show_log_dett);
1434
- return win_show_log_dett;
1435
- }());
1436
-
1437
- var FHConfirmValues = /** @class */ (function () {
1438
- function FHConfirmValues() {
1439
- this.title_dialog = "";
1440
- this.b_commento = false;
1441
- this.msg_dialog = "";
1442
- this.confirm_mgs = "CONFERMA";
1443
- this.annulla_mgs = "ANNULLA";
1444
- this.commento_mgs = "Commento";
1445
- this.insert_comment_msg = "Inserire un commento";
1446
- }
1447
- return FHConfirmValues;
1448
- }());
1449
-
1450
- /**
1451
- * A Sample of how simple it is to create a new window, with its own injects.
1452
- */
1453
- var FHConfirmComponent = /** @class */ (function () {
1454
- function FHConfirmComponent(dialogRef, app_s, conf, toast) {
1455
- this.dialogRef = dialogRef;
1456
- this.app_s = app_s;
1457
- this.conf = conf;
1458
- this.toast = toast;
1459
- this.title = "";
1460
- this.msg = "";
1461
- this.commento = "";
1462
- this.b_commento = false;
1463
- this.confirm_mgs = "CONFERMA";
1464
- this.annulla_mgs = "ANNULLA";
1465
- this.commento_mgs = "Commento";
1466
- this.insert_comment_msg = "Inserire un commento";
1467
- if (conf == null) {
1468
- this.title = localStorage.getItem(this.app_s.COMPANY_KEY + "title_dialog");
1469
- this.msg = localStorage.getItem(this.app_s.COMPANY_KEY + "msg_dialog");
1470
- return;
1471
- }
1472
- this.title = conf.title_dialog;
1473
- this.msg = conf.msg_dialog;
1474
- if (conf.b_commento != null)
1475
- this.b_commento = conf.b_commento;
1476
- if (conf.confirm_mgs != null)
1477
- this.confirm_mgs = conf.confirm_mgs;
1478
- if (conf.annulla_mgs != null)
1479
- this.annulla_mgs = conf.annulla_mgs;
1480
- if (conf.commento_mgs != null)
1481
- this.commento_mgs = conf.commento_mgs;
1482
- if (conf.insert_comment_msg != null)
1483
- this.insert_comment_msg = conf.insert_comment_msg;
1484
- }
1485
- FHConfirmComponent.prototype.ok = function () {
1486
- if (this.b_commento && this.commento == "") {
1487
- this.toast.error(this.insert_comment_msg);
1488
- return;
1489
- }
1490
- this.dialogRef.close(true);
1491
- };
1492
- FHConfirmComponent.prototype.close = function () {
1493
- this.dialogRef.close(null);
1494
- };
1495
- FHConfirmComponent.prototype.setTitle = function (texto) {
1496
- this.title = texto;
1497
- };
1498
- FHConfirmComponent.prototype.setMsg = function (texto) {
1499
- this.msg = texto;
1500
- };
1501
- FHConfirmComponent.prototype.ngAfterViewInit = function () { };
1502
- FHConfirmComponent.ctorParameters = function () { return [
1503
- { type: dialog.MatDialogRef },
1504
- { type: AppService },
1505
- { type: FHConfirmValues, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
1506
- { type: ngxToastr.ToastrService }
1507
- ]; };
1508
- FHConfirmComponent = __decorate([
1509
- core.Component({
1510
- template: "\n <h1 mat-dialog-title>{{ title }}</h1>\n <div mat-dialog-content>\n <div fxLayout=\"column\" fxLayoutGap=\"15px\">\n {{ msg }}\n <div style=\"width:400px\" [hidden]=\"!b_commento\"><br /></div>\n <div style=\"width:400px\" [hidden]=\"!b_commento\">\n <FHTextArea\n label=\"{{ commento_mgs }}\"\n required\n [(ngModel)]=\"commento\"\n ></FHTextArea>\n </div>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <button mat-raised-button (click)=\"ok()\" color=\"primary\">\n {{ confirm_mgs }}\n </button>\n <button mat-raised-button (click)=\"dialogRef.close(false)\" color=\"warn\">\n {{ annulla_mgs }}\n </button>\n </div>\n ",
1511
- styles: [""]
1512
- }),
1513
- __param(2, core.Inject(dialog.MAT_DIALOG_DATA)),
1514
- __metadata("design:paramtypes", [dialog.MatDialogRef,
1515
- AppService,
1516
- FHConfirmValues,
1517
- ngxToastr.ToastrService])
1518
- ], FHConfirmComponent);
1519
- return FHConfirmComponent;
1520
- }());
1521
-
1522
- var FHListComponent = /** @class */ (function () {
1523
- function FHListComponent(_dataService) {
1524
- this._dataService = _dataService;
1525
- this.init_fill = true;
1526
- this.sql = "";
1527
- this.types = [];
1528
- this.values = [];
1529
- this.label = "";
1530
- this.enabled = true;
1531
- this.single_sel = false;
1532
- this.separator = ",";
1533
- this.fillend = new core.EventEmitter();
1534
- this.selchange = new core.EventEmitter();
1535
- this.initend = new core.EventEmitter();
1536
- this.myData = new Array();
1537
- this.selval = "-1";
1538
- this.errorMsg = "";
1539
- this.valDef = "-1";
1540
- }
1541
- FHListComponent.prototype.change_v = function (u, o) {
1542
- u.checked = !u.checked;
1543
- this.upd_f(u, o);
1463
+ FHListComponent.prototype.change_v = function (u, o) {
1464
+ u.checked = !u.checked;
1465
+ this.upd_f(u, o);
1544
1466
  };
1545
1467
  FHListComponent.prototype.upd_f = function (u, b) {
1546
1468
  if (this.single_sel)
@@ -1717,555 +1639,1563 @@
1717
1639
  //this.errorMsg="QUERY NON CONFIGURATA";
1718
1640
  return;
1719
1641
  }
1720
- _this.fillCombo();
1721
- }
1722
- else {
1723
- _this.errorMsg = "";
1724
- }
1725
- _this.initend.emit();
1642
+ _this.fillCombo();
1643
+ }
1644
+ else {
1645
+ _this.errorMsg = "";
1646
+ }
1647
+ _this.initend.emit();
1648
+ });
1649
+ };
1650
+ FHListComponent.prototype.sc = function () {
1651
+ this.selchange.emit();
1652
+ };
1653
+ FHListComponent.ctorParameters = function () { return [
1654
+ { type: QueryService }
1655
+ ]; };
1656
+ __decorate([
1657
+ core.Input(),
1658
+ __metadata("design:type", Boolean)
1659
+ ], FHListComponent.prototype, "init_fill", void 0);
1660
+ __decorate([
1661
+ core.Input(),
1662
+ __metadata("design:type", String)
1663
+ ], FHListComponent.prototype, "sql", void 0);
1664
+ __decorate([
1665
+ core.Input(),
1666
+ __metadata("design:type", Array)
1667
+ ], FHListComponent.prototype, "types", void 0);
1668
+ __decorate([
1669
+ core.Input(),
1670
+ __metadata("design:type", Array)
1671
+ ], FHListComponent.prototype, "values", void 0);
1672
+ __decorate([
1673
+ core.Input(),
1674
+ __metadata("design:type", String)
1675
+ ], FHListComponent.prototype, "label", void 0);
1676
+ __decorate([
1677
+ core.Input(),
1678
+ __metadata("design:type", Boolean)
1679
+ ], FHListComponent.prototype, "enabled", void 0);
1680
+ __decorate([
1681
+ core.Input(),
1682
+ __metadata("design:type", Boolean)
1683
+ ], FHListComponent.prototype, "single_sel", void 0);
1684
+ __decorate([
1685
+ core.Input(),
1686
+ __metadata("design:type", String)
1687
+ ], FHListComponent.prototype, "separator", void 0);
1688
+ __decorate([
1689
+ core.ViewChild("cmb"),
1690
+ __metadata("design:type", core.ElementRef)
1691
+ ], FHListComponent.prototype, "smtr", void 0);
1692
+ __decorate([
1693
+ core.Output(),
1694
+ __metadata("design:type", core.EventEmitter)
1695
+ ], FHListComponent.prototype, "fillend", void 0);
1696
+ __decorate([
1697
+ core.Output(),
1698
+ __metadata("design:type", core.EventEmitter)
1699
+ ], FHListComponent.prototype, "selchange", void 0);
1700
+ __decorate([
1701
+ core.Output(),
1702
+ __metadata("design:type", core.EventEmitter)
1703
+ ], FHListComponent.prototype, "initend", void 0);
1704
+ FHListComponent = __decorate([
1705
+ core.Component({
1706
+ selector: "FHList",
1707
+ template: "\n <table class=\"fh_table\" style=\"width:100%;\">\n <thead>\n <tr>\n <th *ngIf=\"!single_sel\"></th>\n <th>\n {{ label }}\n </th>\n <th *ngIf=\"single_sel\"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let u of myData; let odd = odd; let even = even\"\n [ngClass]=\"{ odd: odd, even: even }\"\n >\n <td style=\"width:20px;\" valign=\"middle\" *ngIf=\"!single_sel\">\n <mat-slide-toggle\n (change)=\"upd_f(u, $event)\"\n [disabled]=\"!enabled\"\n [(ngModel)]=\"u.checked\"\n ></mat-slide-toggle>\n </td>\n <td (click)=\"change_v(u, $event)\" valign=\"middle\">\n {{ u.descrizione_valore }}\n </td>\n <td\n valign=\"middle\"\n style=\"width:20px;text-align: center\"\n *ngIf=\"single_sel\"\n >\n <button\n mat-flat-button\n color=\"primary\"\n (click)=\"upd_f(u, $event)\"\n [disabled]=\"!enabled\"\n >\n <mat-icon>send</mat-icon></button\n >&nbsp;&nbsp;&nbsp;\n </td>\n </tr>\n </tbody>\n </table>\n ",
1708
+ styles: [""]
1709
+ }),
1710
+ __metadata("design:paramtypes", [QueryService])
1711
+ ], FHListComponent);
1712
+ return FHListComponent;
1713
+ }());
1714
+
1715
+ var WinWait = /** @class */ (function () {
1716
+ function WinWait(dialogRef, data) {
1717
+ this.dialogRef = dialogRef;
1718
+ this.data = data;
1719
+ this.label = "";
1720
+ this.progress_p = 0;
1721
+ if (data != null) {
1722
+ if (data.label != null)
1723
+ this.label = data.label;
1724
+ if (data.progress_p != null)
1725
+ this.progress_p = data.progress_p;
1726
+ }
1727
+ }
1728
+ WinWait.prototype.close = function () {
1729
+ this.dialogRef.close(null);
1730
+ };
1731
+ WinWait.prototype.update_progess = function (p) {
1732
+ this.progress_p = p;
1733
+ if (p == 100)
1734
+ this.dialogRef.close();
1735
+ };
1736
+ WinWait.prototype.ngAfterViewInit = function () { };
1737
+ WinWait.ctorParameters = function () { return [
1738
+ { type: dialog.MatDialogRef },
1739
+ { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
1740
+ ]; };
1741
+ __decorate([
1742
+ core.ViewChild("cmb_sel"),
1743
+ __metadata("design:type", FHListComponent)
1744
+ ], WinWait.prototype, "cmb_sel", void 0);
1745
+ WinWait = __decorate([
1746
+ core.Component({
1747
+ selector: "fhwinwait",
1748
+ template: "\n <h2 mat-dialog-title>\n {{ label | uppercase }}\n </h2>\n <mat-dialog-content style=\"min-width:700px\">\n <mat-progress-bar\n style=\"height:50px\"\n color=\"accent\"\n mode=\"determinate\"\n value=\"{{ progress_p }}\"\n ></mat-progress-bar>\n </mat-dialog-content>\n "
1749
+ }),
1750
+ __param(1, core.Inject(dialog.MAT_DIALOG_DATA)),
1751
+ __metadata("design:paramtypes", [dialog.MatDialogRef, Object])
1752
+ ], WinWait);
1753
+ return WinWait;
1754
+ }());
1755
+
1756
+ var FHConfirmValues = /** @class */ (function () {
1757
+ function FHConfirmValues() {
1758
+ this.title_dialog = "";
1759
+ this.b_commento = false;
1760
+ this.msg_dialog = "";
1761
+ this.confirm_mgs = "CONFERMA";
1762
+ this.annulla_mgs = "ANNULLA";
1763
+ this.commento_mgs = "Commento";
1764
+ this.insert_comment_msg = "Inserire un commento";
1765
+ }
1766
+ return FHConfirmValues;
1767
+ }());
1768
+
1769
+ /**
1770
+ * A Sample of how simple it is to create a new window, with its own injects.
1771
+ */
1772
+ var FHConfirmComponent = /** @class */ (function () {
1773
+ function FHConfirmComponent(dialogRef, app_s, conf, toast) {
1774
+ this.dialogRef = dialogRef;
1775
+ this.app_s = app_s;
1776
+ this.conf = conf;
1777
+ this.toast = toast;
1778
+ this.title = "";
1779
+ this.msg = "";
1780
+ this.commento = "";
1781
+ this.b_commento = false;
1782
+ this.confirm_mgs = "CONFERMA";
1783
+ this.annulla_mgs = "ANNULLA";
1784
+ this.commento_mgs = "Commento";
1785
+ this.insert_comment_msg = "Inserire un commento";
1786
+ if (conf == null) {
1787
+ this.title = localStorage.getItem(this.app_s.COMPANY_KEY + "title_dialog");
1788
+ this.msg = localStorage.getItem(this.app_s.COMPANY_KEY + "msg_dialog");
1789
+ return;
1790
+ }
1791
+ this.title = conf.title_dialog;
1792
+ this.msg = conf.msg_dialog;
1793
+ if (conf.b_commento != null)
1794
+ this.b_commento = conf.b_commento;
1795
+ if (conf.confirm_mgs != null)
1796
+ this.confirm_mgs = conf.confirm_mgs;
1797
+ if (conf.annulla_mgs != null)
1798
+ this.annulla_mgs = conf.annulla_mgs;
1799
+ if (conf.commento_mgs != null)
1800
+ this.commento_mgs = conf.commento_mgs;
1801
+ if (conf.insert_comment_msg != null)
1802
+ this.insert_comment_msg = conf.insert_comment_msg;
1803
+ }
1804
+ FHConfirmComponent.prototype.ok = function () {
1805
+ if (this.b_commento && this.commento == "") {
1806
+ this.toast.error(this.insert_comment_msg);
1807
+ return;
1808
+ }
1809
+ this.dialogRef.close(true);
1810
+ };
1811
+ FHConfirmComponent.prototype.close = function () {
1812
+ this.dialogRef.close(null);
1813
+ };
1814
+ FHConfirmComponent.prototype.setTitle = function (texto) {
1815
+ this.title = texto;
1816
+ };
1817
+ FHConfirmComponent.prototype.setMsg = function (texto) {
1818
+ this.msg = texto;
1819
+ };
1820
+ FHConfirmComponent.prototype.ngAfterViewInit = function () { };
1821
+ FHConfirmComponent.ctorParameters = function () { return [
1822
+ { type: dialog.MatDialogRef },
1823
+ { type: AppService },
1824
+ { type: FHConfirmValues, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] },
1825
+ { type: ngxToastr.ToastrService }
1826
+ ]; };
1827
+ FHConfirmComponent = __decorate([
1828
+ core.Component({
1829
+ template: "\n <h1 mat-dialog-title>{{ title }}</h1>\n <div mat-dialog-content>\n <div fxLayout=\"column\" fxLayoutGap=\"15px\">\n {{ msg }}\n <div style=\"width:400px\" [hidden]=\"!b_commento\"><br /></div>\n <div style=\"width:400px\" [hidden]=\"!b_commento\">\n <FHTextArea\n label=\"{{ commento_mgs }}\"\n required\n [(ngModel)]=\"commento\"\n ></FHTextArea>\n </div>\n </div>\n </div>\n\n <div mat-dialog-actions>\n <button mat-raised-button (click)=\"ok()\" color=\"primary\">\n {{ confirm_mgs }}\n </button>\n <button mat-raised-button (click)=\"dialogRef.close(false)\" color=\"warn\">\n {{ annulla_mgs }}\n </button>\n </div>\n ",
1830
+ styles: [""]
1831
+ }),
1832
+ __param(2, core.Inject(dialog.MAT_DIALOG_DATA)),
1833
+ __metadata("design:paramtypes", [dialog.MatDialogRef,
1834
+ AppService,
1835
+ FHConfirmValues,
1836
+ ngxToastr.ToastrService])
1837
+ ], FHConfirmComponent);
1838
+ return FHConfirmComponent;
1839
+ }());
1840
+
1841
+ var FHUploadS3Component = /** @class */ (function () {
1842
+ function FHUploadS3Component(_dataService, toastr, dialog, app_s, uti) {
1843
+ var _this = this;
1844
+ this._dataService = _dataService;
1845
+ this.toastr = toastr;
1846
+ this.dialog = dialog;
1847
+ this.app_s = app_s;
1848
+ this.uti = uti;
1849
+ this.show_descri = true;
1850
+ this.enabled = true;
1851
+ this.single = true;
1852
+ this.descri_obb = false;
1853
+ this.programma_da_eseguire = "";
1854
+ this.label_attendere = "ATTENDERE UPLOAD IN CORSO";
1855
+ this.fixed_label = " (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)";
1856
+ this.limit_string = "Il file di <size>MB supera il limite di 500MB";
1857
+ this.allegato_inserito = "ALLEGATO INSERITO";
1858
+ this.inserire_descrizione = "Descrizione Obbligatoria";
1859
+ this.lista_allegati = [];
1860
+ this.change = new core.EventEmitter();
1861
+ this.upload_ended = new core.EventEmitter();
1862
+ this.call_upload = new core.EventEmitter();
1863
+ this.multi_list = false;
1864
+ this.allow_delete = false;
1865
+ this.loading = false;
1866
+ this.App = "";
1867
+ this.K = "";
1868
+ this.label_b = "";
1869
+ this.descrizione = "";
1870
+ this.file_name = "";
1871
+ this.label = "";
1872
+ this.username = "";
1873
+ this.b_edit_loaded = false;
1874
+ this.tipo = "";
1875
+ this.b_ini = false;
1876
+ this.uploader = new ng2FileUpload.FileUploader({
1877
+ url: this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT + '_new',
1878
+ maxFileSize: 500 * 1024 * 1024,
1879
+ });
1880
+ this.id = null;
1881
+ this.p_cod_doc = '';
1882
+ this.p_section = '';
1883
+ this.p_system_type = '';
1884
+ this.username = this.app_s.user;
1885
+ this.uploader.onBeforeUploadItem = function (item) {
1886
+ item.withCredentials = false;
1887
+ };
1888
+ console.log('uploader ', this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT + '_new');
1889
+ this.uploader.onCompleteItem = function (item, response, status, header) {
1890
+ if (status === 200) {
1891
+ _this.descrizione = "";
1892
+ _this.toastr.info("INFO", _this.allegato_inserito, {
1893
+ timeOut: 1000,
1894
+ progressBar: true,
1895
+ });
1896
+ _this.ref_allegato();
1897
+ _this.change.emit({
1898
+ item: item,
1899
+ response: response,
1900
+ status: status,
1901
+ header: header,
1902
+ });
1903
+ }
1904
+ };
1905
+ }
1906
+ FHUploadS3Component.prototype.call_up = function () {
1907
+ this.call_upload.emit({
1908
+ App: this.App,
1909
+ K: this.K,
1910
+ descrizione: this.descrizione,
1911
+ single: false,
1912
+ username: this.app_s.user,
1913
+ tipo: this.tipo,
1914
+ local_path: this.app_s.LOCAL_PATH,
1915
+ p1: this.programma_da_eseguire,
1916
+ });
1917
+ };
1918
+ FHUploadS3Component.prototype.del_doc = function () {
1919
+ var _this = this;
1920
+ localStorage.setItem(this.app_s.COMPANY_KEY + "title_dialog", "Conferma Operazione");
1921
+ localStorage.setItem(this.app_s.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
1922
+ var dialogRef = this.dialog.open(FHConfirmComponent);
1923
+ dialogRef.afterClosed().subscribe(function (result) {
1924
+ if (result) {
1925
+ var p = new QParam();
1926
+ p.sql = "DELETE_ALLEGATO";
1927
+ p.types = ["int", "string"];
1928
+ p.values = [_this.id, _this.app_s.user];
1929
+ var ok_op = false;
1930
+ _this._dataService.doQuery(p).subscribe(function (data) {
1931
+ var ok_op = false;
1932
+ if (data != null)
1933
+ if (data.result_msg == "OK") {
1934
+ // this.arr_g = data.result_data;
1935
+ _this.ref_allegato();
1936
+ _this.toastr.info("INFO", "ALLEGATO ELIMINATO", {
1937
+ timeOut: 1000,
1938
+ progressBar: true,
1939
+ });
1940
+ ok_op = true;
1941
+ }
1942
+ }, function (err) { });
1943
+ }
1944
+ });
1945
+ };
1946
+ FHUploadS3Component.prototype.load_types = function () {
1947
+ var _this = this;
1948
+ if (this.cmb_tipo == null) {
1949
+ setTimeout(function () {
1950
+ _this.load_types();
1951
+ }, 200);
1952
+ return;
1953
+ }
1954
+ if (this.tipo == "") {
1955
+ setTimeout(function () {
1956
+ _this.load_types();
1957
+ }, 200);
1958
+ return;
1959
+ }
1960
+ console.log("this.cmb_tipo.sql ", this.cmb_tipo.sql);
1961
+ this.cmb_tipo.sql = this.tipo;
1962
+ this.cmb_tipo.fillCombo();
1963
+ };
1964
+ FHUploadS3Component.prototype.ngAfterViewInit = function () {
1965
+ var _this = this;
1966
+ setTimeout(function () {
1967
+ var uo = {};
1968
+ uo.headers = [
1969
+ {
1970
+ name: "Authorization",
1971
+ value: "Bearer " + localStorage.getItem(_this.app_s.COMPANY_KEY + "token"),
1972
+ },
1973
+ ];
1974
+ // console.log('ngAfterViewInit!!');
1975
+ _this.uploader.setOptions(uo);
1976
+ _this.uploader.onCompleteAll = function () {
1977
+ _this.loading = false;
1978
+ _this.upload_ended.emit();
1979
+ if (_this.dialogRef != null)
1980
+ if (_this.dialogRef.componentInstance != null) {
1981
+ _this.dialogRef.componentInstance.update_progess(100);
1982
+ _this.dialogRef = null;
1983
+ }
1984
+ };
1985
+ _this.uploader.onErrorItem = function (a, b, c, d) {
1986
+ _this.toastr.error(b);
1987
+ };
1988
+ _this.uploader.onAfterAddingFile = function (fileItem) {
1989
+ _this.ch(fileItem);
1990
+ };
1991
+ _this.uploader.onProgressItem = function (fileItem, progress) {
1992
+ // console.log(fileItem);
1993
+ // console.log(progress);
1994
+ _this.loading = true;
1995
+ if (_this.dialogRef != null)
1996
+ if (_this.dialogRef.componentInstance != null)
1997
+ _this.dialogRef.componentInstance.update_progess(progress);
1998
+ };
1999
+ _this.uploader.onWhenAddingFileFailed = function (item, filter, options) {
2000
+ switch (filter.name) {
2001
+ case "fileSize":
2002
+ var ar = Math.round(item.size / 1024 / 1024);
2003
+ _this.toastr.error(_this.limit_string.split("<size>").join("" + ar));
2004
+ break;
2005
+ default:
2006
+ _this.toastr.error("Errore: " + filter.name);
2007
+ }
2008
+ };
2009
+ });
2010
+ };
2011
+ FHUploadS3Component.prototype.download_all = function () {
2012
+ window.open(this.app_s.COMPANY_SITE_ROOT +
2013
+ "/uploads/" +
2014
+ this.App +
2015
+ "/" +
2016
+ this.K +
2017
+ "/" +
2018
+ this.file_name);
2019
+ };
2020
+ FHUploadS3Component.prototype.ch = function (fileItem) {
2021
+ var _this = this;
2022
+ if (this.descri_obb && this.descrizione == "") {
2023
+ this.toastr.error(this.inserire_descrizione);
2024
+ return;
2025
+ }
2026
+ /*
2027
+ for (let i = 0; i < this.lista_allegati.length; i++) {
2028
+ if (
2029
+ this.lista_allegati[i].file_name_orig.toLowerCase() ==
2030
+ fileItem.file.name.toLowerCase()
2031
+ ) {
2032
+ this.toastr.error("File già presente (cancellarlo per aggiornarlo)");
2033
+ return;
2034
+ }
2035
+ }*/
2036
+ this.uploader.onBuildItemForm = function (item, form) {
2037
+ form.append("App", _this.App);
2038
+ form.append("K", _this.K);
2039
+ form.append("descrizione", _this.descrizione);
2040
+ form.append("single", _this.single);
2041
+ form.append("username", _this.username);
2042
+ form.append("system_type", _this.p_system_type);
2043
+ form.append('uiid', _this.uti.newGuid());
2044
+ form.append('doc_number', _this.p_cod_doc);
2045
+ form.append('repo_uiid', 'S3');
2046
+ form.append('parent_doc_type', _this.App);
2047
+ form.append('parent_doc_rif', _this.p_cod_doc);
2048
+ form.append('parent_doc_uiid', _this.K);
2049
+ form.append('parent_doc_section', _this.p_section);
2050
+ form.append('version', 1);
2051
+ form.append('status', 'PUBLISHED');
2052
+ form.append('p_owner', _this.app_s.user);
2053
+ // if (this.multi_list)
2054
+ // form.append("tipo", this.cmb_tipo.getDescri().split("-1").join(""));
2055
+ // else form.append("tipo", this.tipo);
2056
+ form.append("tipo", '');
2057
+ form.append("local_path", _this.app_s.LOCAL_PATH);
2058
+ if (_this.programma_da_eseguire != "")
2059
+ form.append("p1", _this.programma_da_eseguire);
2060
+ };
2061
+ if (this.dialogRef == null) {
2062
+ this.dialogRef = this.dialog.open(WinWait, { disableClose: true });
2063
+ setTimeout(function () {
2064
+ _this.dialogRef.componentInstance.label = _this.label_attendere;
2065
+ });
2066
+ this.dialogRef.afterClosed().subscribe(function (result) {
2067
+ if (result != "") {
2068
+ }
2069
+ });
2070
+ }
2071
+ this.uploader.uploadAll();
2072
+ };
2073
+ FHUploadS3Component.prototype.init = function (p_app, p_k, p_cod_doc, p_section, p_label, p_system_type, programma_da_eseguire, allow_delete) {
2074
+ if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
2075
+ if (allow_delete === void 0) { allow_delete = false; }
2076
+ this.App = p_app;
2077
+ this.K = p_k;
2078
+ this.label = p_label;
2079
+ this.p_cod_doc = p_cod_doc;
2080
+ this.p_section = p_section;
2081
+ this.p_system_type = p_system_type;
2082
+ this.b_ini = true;
2083
+ this.b_edit_loaded = false;
2084
+ this.descrizione = "";
2085
+ this.programma_da_eseguire = programma_da_eseguire;
2086
+ this.allow_delete = allow_delete;
2087
+ this.ref_allegato();
2088
+ // console.log('init! ',this.tipo)
2089
+ if (this.tipo.indexOf("SELECT_") > -1) {
2090
+ this.multi_list = true;
2091
+ this.load_types();
2092
+ //console.log('fillCombo');
2093
+ }
2094
+ };
2095
+ FHUploadS3Component.prototype.ref_allegato = function () {
2096
+ var _this = this;
2097
+ // console.log(' ref_allegato')
2098
+ this.id = null;
2099
+ this.descrizione = "";
2100
+ this.file_name = "";
2101
+ this.label_b = "";
2102
+ this.cmb_tipo.resetValue();
2103
+ if (!this.single)
2104
+ return;
2105
+ if (this.App == null)
2106
+ return;
2107
+ if (this.App == "")
2108
+ return;
2109
+ var p = new QParam();
2110
+ p.sql = "SELECT_ALLEGATO_INFO_NEW";
2111
+ p.types = ["string", "string"];
2112
+ p.values = [this.App, this.K];
2113
+ this._dataService.doQuery(p).subscribe(function (data) {
2114
+ if (data != null)
2115
+ if (data.result_msg == "OK") {
2116
+ var a = data.result_data;
2117
+ if (a.length > 0) {
2118
+ _this.id = a[0].id;
2119
+ _this.descrizione = a[0].descrizione;
2120
+ _this.file_name = a[0].file_name_orig;
2121
+ _this.label_b = "" + a[0].file_name_orig + " - " + a[0].dim + "";
2122
+ _this.b_edit_loaded = true;
2123
+ }
2124
+ }
2125
+ });
2126
+ };
2127
+ FHUploadS3Component.ctorParameters = function () { return [
2128
+ { type: QueryService },
2129
+ { type: ngxToastr.ToastrService },
2130
+ { type: dialog.MatDialog },
2131
+ { type: AppService },
2132
+ { type: UtilityService }
2133
+ ]; };
2134
+ __decorate([
2135
+ core.Input(),
2136
+ __metadata("design:type", Boolean)
2137
+ ], FHUploadS3Component.prototype, "show_descri", void 0);
2138
+ __decorate([
2139
+ core.Input(),
2140
+ __metadata("design:type", Boolean)
2141
+ ], FHUploadS3Component.prototype, "enabled", void 0);
2142
+ __decorate([
2143
+ core.Input(),
2144
+ __metadata("design:type", Boolean)
2145
+ ], FHUploadS3Component.prototype, "single", void 0);
2146
+ __decorate([
2147
+ core.Input(),
2148
+ __metadata("design:type", Boolean)
2149
+ ], FHUploadS3Component.prototype, "descri_obb", void 0);
2150
+ __decorate([
2151
+ core.Input(),
2152
+ __metadata("design:type", String)
2153
+ ], FHUploadS3Component.prototype, "programma_da_eseguire", void 0);
2154
+ __decorate([
2155
+ core.Input(),
2156
+ __metadata("design:type", String)
2157
+ ], FHUploadS3Component.prototype, "label_attendere", void 0);
2158
+ __decorate([
2159
+ core.Input(),
2160
+ __metadata("design:type", String)
2161
+ ], FHUploadS3Component.prototype, "fixed_label", void 0);
2162
+ __decorate([
2163
+ core.Input(),
2164
+ __metadata("design:type", String)
2165
+ ], FHUploadS3Component.prototype, "limit_string", void 0);
2166
+ __decorate([
2167
+ core.Input(),
2168
+ __metadata("design:type", String)
2169
+ ], FHUploadS3Component.prototype, "allegato_inserito", void 0);
2170
+ __decorate([
2171
+ core.Input(),
2172
+ __metadata("design:type", String)
2173
+ ], FHUploadS3Component.prototype, "inserire_descrizione", void 0);
2174
+ __decorate([
2175
+ core.Input(),
2176
+ __metadata("design:type", Array)
2177
+ ], FHUploadS3Component.prototype, "lista_allegati", void 0);
2178
+ __decorate([
2179
+ core.Output(),
2180
+ __metadata("design:type", core.EventEmitter)
2181
+ ], FHUploadS3Component.prototype, "change", void 0);
2182
+ __decorate([
2183
+ core.Output(),
2184
+ __metadata("design:type", core.EventEmitter)
2185
+ ], FHUploadS3Component.prototype, "upload_ended", void 0);
2186
+ __decorate([
2187
+ core.Output(),
2188
+ __metadata("design:type", core.EventEmitter)
2189
+ ], FHUploadS3Component.prototype, "call_upload", void 0);
2190
+ __decorate([
2191
+ core.ViewChild("cmb_tipo"),
2192
+ __metadata("design:type", FHComboboxComponent)
2193
+ ], FHUploadS3Component.prototype, "cmb_tipo", void 0);
2194
+ FHUploadS3Component = __decorate([
2195
+ core.Component({
2196
+ selector: "FHUploadS3",
2197
+ template: "\n FHUPLOAD: {{p_section}}\n <div *ngIf=\"loading\" fxLayout=\"row\">\n WAIT\n </div>\n <div\n [hidden]=\"!(enabled && !loading)\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start center\"\n >\n <div\n [hidden]=\"!multi_list\"\n style=\"width:380px\"\n fxLayoutAlign=\"start center\"\n >\n <FHComboBox\n [sql]=\"tipo\"\n #cmb_tipo\n [init_fill]=\"false\"\n label=\"Tipologia\"\n ></FHComboBox\n >&nbsp;&nbsp;\n </div>\n <mat-form-field\n [hidden]=\"!show_descri\"\n style=\"width: 100%\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }} {{ fixed_label }}</mat-label>\n <input\n matInput\n type=\"text\"\n name=\"descrizione\"\n [(ngModel)]=\"descrizione\"\n />\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\n <div\n style=\"width:140px\"\n fxLayout=\"row\"\n fxLayoutAlign=\"start start\"\n (click)=\"call_up()\"\n >\n <input\n type=\"file\"\n multiple\n ng2FileSelect\n [uploader]=\"uploader\"\n name=\"file-fh{{ App }}\"\n id=\"file-fh{{ App }}\"\n class=\"inputfile inputfile-fh\"\n />\n <label for=\"file-fh{{ App }}\" style=\"width:210px\"\n ><svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"17\"\n viewBox=\"0 0 20 17\"\n >\n <path\n d=\"M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z\"\n /></svg\n ><span style=\"font-size: 12px\">&nbsp;&nbsp;&nbsp;Upload</span></label\n >\n </div>\n <div fxLayout=\"row\" fxLayoutAlign=\"start start\">\n <button\n mat-flat-button\n *ngIf=\"b_edit_loaded\"\n (click)=\"download_all()\"\n style=\"font-size: 12px\"\n >\n {{ label_b }}</button\n >&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n *ngIf=\"id != null && allow_delete\"\n (click)=\"del_doc()\"\n color=\"warn\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div *ngIf=\"!enabled\" fxLayout=\"row\" fxLayoutGap=\"10px\">\n <label>{{ label }}:</label>\n <div *ngIf=\"label != descrizione\">{{ descrizione }}</div>\n <button\n mat-flat-button\n *ngIf=\"b_edit_loaded\"\n (click)=\"download_all()\"\n style=\"font-size: 12px;background-color: #F5F5F5\"\n >\n {{ label_b }}\n </button>\n </div>\n ",
2198
+ styles: [""]
2199
+ }),
2200
+ __metadata("design:paramtypes", [QueryService,
2201
+ ngxToastr.ToastrService,
2202
+ dialog.MatDialog,
2203
+ AppService, UtilityService])
2204
+ ], FHUploadS3Component);
2205
+ return FHUploadS3Component;
2206
+ }());
2207
+
2208
+ var FSInput = /** @class */ (function () {
2209
+ function FSInput() {
2210
+ this.command = "";
2211
+ this.p1 = "";
2212
+ this.p2 = "";
2213
+ }
2214
+ return FSInput;
2215
+ }());
2216
+
2217
+ var FHWinComboSelect = /** @class */ (function () {
2218
+ function FHWinComboSelect(dialogRef, toastr, data) {
2219
+ this.dialogRef = dialogRef;
2220
+ this.toastr = toastr;
2221
+ this.data = data;
2222
+ this.label = "";
2223
+ this.width = "100%";
2224
+ this.nota = false;
2225
+ this.nota_val = "";
2226
+ if (data == null)
2227
+ return;
2228
+ if (data != null) {
2229
+ var lab = "";
2230
+ var arrd = [];
2231
+ var nota = false;
2232
+ if (data.label != null)
2233
+ lab = data.label;
2234
+ if (data.arr_option != null)
2235
+ arrd = data.arr_option;
2236
+ if (data.nota != null)
2237
+ nota = data.nota;
2238
+ this.set_selection(lab, arrd, nota);
2239
+ }
2240
+ }
2241
+ FHWinComboSelect.prototype.close = function () {
2242
+ this.dialogRef.close(null);
2243
+ };
2244
+ FHWinComboSelect.prototype.set_selection = function (lab, myD, nota) {
2245
+ if (nota === void 0) { nota = false; }
2246
+ this.nota = nota;
2247
+ this.label = lab;
2248
+ for (var i = 0; i < myD.length; i++)
2249
+ this.cmb_sel.add_option(myD[i]);
2250
+ };
2251
+ FHWinComboSelect.prototype.ok = function () {
2252
+ if (this.cmb_sel.getValue() == "-1") {
2253
+ this.toastr.error("Selezionare un valore");
2254
+ return;
2255
+ }
2256
+ this.cmb_sel.getObj().nota = this.nota_val;
2257
+ this.dialogRef.close(this.cmb_sel.getObj());
2258
+ };
2259
+ FHWinComboSelect.prototype.ngAfterViewInit = function () { };
2260
+ FHWinComboSelect.ctorParameters = function () { return [
2261
+ { type: dialog.MatDialogRef },
2262
+ { type: ngxToastr.ToastrService },
2263
+ { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
2264
+ ]; };
2265
+ __decorate([
2266
+ core.ViewChild("cmb_sel"),
2267
+ __metadata("design:type", FHComboboxComponent)
2268
+ ], FHWinComboSelect.prototype, "cmb_sel", void 0);
2269
+ FHWinComboSelect = __decorate([
2270
+ core.Component({
2271
+ selector: "fhwincomboselect",
2272
+ template: "\n <div style=\"width:100%\" fxLayout=\"row\" fxLayoutAlign=\"end start\">\n <img\n src=\"assets/icons/x.png\"\n style=\"cursor: pointer;\"\n (click)=\"close()\"\n />\n </div>\n <hr width=\"100%\" size=\"0.5\" color=\"#DDDDDD\" />\n\n <div fxLayout=\"column\">\n <mat-dialog-content style=\"font-size: 15px;\">\n <div fxLayout=\"column\">\n <h3>\n {{ label | uppercase }}\n </h3>\n <FHComboBox #cmb_sel [init_fill]=\"false\"></FHComboBox>\n <mat-form-field *ngIf=\"nota\" appearance=\"outline\" floatLabel=\"always\"\n ><mat-label>Nota</mat-label>\n <textarea matInput [(ngModel)]=\"nota_val\" rows=\"12\"></textarea>\n </mat-form-field>\n </div>\n </mat-dialog-content>\n\n <mat-dialog-actions\n fxFlex=\"100\"\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n >\n <button mat-flat-button color=\"primary\" (click)=\"ok()\">OK</button\n >&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color=\"warn\" (click)=\"close()\">ANNULLA</button>\n </mat-dialog-actions>\n </div>\n "
2273
+ }),
2274
+ __param(2, core.Inject(dialog.MAT_DIALOG_DATA)),
2275
+ __metadata("design:paramtypes", [dialog.MatDialogRef,
2276
+ ngxToastr.ToastrService, Object])
2277
+ ], FHWinComboSelect);
2278
+ return FHWinComboSelect;
2279
+ }());
2280
+
2281
+ var WinAskTextBigComponent = /** @class */ (function () {
2282
+ function WinAskTextBigComponent(dialogRef, toastr, data) {
2283
+ this.dialogRef = dialogRef;
2284
+ this.toastr = toastr;
2285
+ this.data = data;
2286
+ this.title = "";
2287
+ this.label = "";
2288
+ this.valore = "";
2289
+ this.readonly = false;
2290
+ this.show_annulla = true;
2291
+ this.show_ok = true;
2292
+ this.min_chars = 3;
2293
+ if (data != null) {
2294
+ if (data.title != null)
2295
+ this.title = data.title;
2296
+ if (data.label != null)
2297
+ this.label = data.label;
2298
+ if (data.valore != null)
2299
+ this.valore = data.valore;
2300
+ if (data.readonly != null)
2301
+ this.readonly = data.readonly;
2302
+ if (data.show_annulla != null)
2303
+ this.show_annulla = data.show_annulla;
2304
+ if (data.show_ok != null)
2305
+ this.show_ok = data.show_ok;
2306
+ if (data.min_chars != null)
2307
+ this.min_chars = data.min_chars;
2308
+ }
2309
+ }
2310
+ WinAskTextBigComponent.prototype.ngAfterViewInit = function () { };
2311
+ WinAskTextBigComponent.prototype.close = function () {
2312
+ this.dialogRef.close(null);
2313
+ };
2314
+ WinAskTextBigComponent.prototype.show = function () { };
2315
+ WinAskTextBigComponent.prototype.hide = function () {
2316
+ this.dialogRef.close(null);
2317
+ };
2318
+ WinAskTextBigComponent.prototype.do_check = function () {
2319
+ if (this.valore.length < this.min_chars) {
2320
+ this.toastr.error("Il valore deve contenere almeno " + this.min_chars + " caratteri");
2321
+ return;
2322
+ }
2323
+ this.dialogRef.close(this.valore);
2324
+ };
2325
+ WinAskTextBigComponent.prototype.chiudi = function () {
2326
+ this.dialogRef.close(null);
2327
+ };
2328
+ WinAskTextBigComponent.ctorParameters = function () { return [
2329
+ { type: dialog.MatDialogRef },
2330
+ { type: ngxToastr.ToastrService },
2331
+ { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
2332
+ ]; };
2333
+ WinAskTextBigComponent = __decorate([
2334
+ core.Component({
2335
+ selector: "app-win_ask_text",
2336
+ template: "\n <div style=\"width:100%\" fxLayout=\"row\" fxLayoutAlign=\"end start\">\n <img\n src=\"assets/icons/x.png\"\n style=\"cursor: pointer;\"\n (click)=\"close()\"\n />\n </div>\n <hr width=\"100%\" size=\"0.5\" color=\"#DDDDDD\" />\n\n <h2 mat-dialog-title>{{ title }}</h2>\n <mat-dialog-content style=\"width:630px;font-size: 15px;\">\n <mat-form-field\n appearance=\"outline\"\n floatLabel=\"always\"\n style=\"width:100%\"\n ><mat-label>{{ label }}</mat-label>\n <textarea\n matInput\n [readonly]=\"readonly\"\n [(ngModel)]=\"valore\"\n rows=\"15\"\n required\n ></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n style=\"width: 100%\"\n [hidden]=\"readonly\"\n >\n <button\n *ngIf=\"show_ok\"\n mat-flat-button\n color=\"primary\"\n (click)=\"do_check()\"\n >\n OK</button\n >&nbsp;&nbsp;&nbsp;\n <button\n *ngIf=\"show_annulla\"\n mat-flat-button\n color=\"warn\"\n (click)=\"chiudi()\"\n >\n ANNULLA\n </button>\n </div>\n <div\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n style=\"width: 100%\"\n [hidden]=\"!readonly\"\n >\n <button\n *ngIf=\"show_annulla\"\n mat-flat-button\n color=\"warn\"\n (click)=\"chiudi()\"\n >\n CHIUDI\n </button>\n </div>\n </mat-dialog-actions>\n "
2337
+ }),
2338
+ __param(2, core.Inject(dialog.MAT_DIALOG_DATA)),
2339
+ __metadata("design:paramtypes", [dialog.MatDialogRef,
2340
+ ngxToastr.ToastrService, Object])
2341
+ ], WinAskTextBigComponent);
2342
+ return WinAskTextBigComponent;
2343
+ }());
2344
+
2345
+ var FileService = /** @class */ (function () {
2346
+ function FileService(http, app_s, toastr) {
2347
+ this.http = http;
2348
+ this.app_s = app_s;
2349
+ this.toastr = toastr;
2350
+ this.url = this.app_s.API_ENDPOINT + this.app_s.FILE_ENDPOINT; // URL to web API this.app_s.API_ENDPOINT
2351
+ }
2352
+ FileService.prototype.doQuery = function (queryp, displayError) {
2353
+ var _this = this;
2354
+ if (displayError === void 0) { displayError = true; }
2355
+ this.headers = new http.HttpHeaders({
2356
+ "Content-Type": "application/json",
2357
+ Authorization: "Bearer " + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
2358
+ });
2359
+ this.url = this.app_s.API_ENDPOINT + this.app_s.FILE_ENDPOINT;
2360
+ // console.log('FileService url: '+ this.url);
2361
+ var post_v = JSON.stringify(queryp);
2362
+ // console.log(post_v);
2363
+ return this.http
2364
+ .post(this.url, post_v, {
2365
+ headers: this.headers,
2366
+ })
2367
+ .pipe(operators.map(function (res) {
2368
+ // Handle errors, display if enabled
2369
+ var r = res;
2370
+ var err;
2371
+ if (!res) {
2372
+ err = new Error("Empty server response");
2373
+ }
2374
+ else if (r.result_msg === "KO") {
2375
+ err = new Error(r.msg);
2376
+ }
2377
+ if (err) {
2378
+ console.error(err);
2379
+ if (displayError) {
2380
+ _this.toastr.error(err.message);
2381
+ }
2382
+ throw new Error(err);
2383
+ }
2384
+ return res || new QGResult();
2385
+ }), operators.catchError(function (err) {
2386
+ // In a real world app, we might use a remote logging infrastructure
2387
+ // We'd also dig deeper into the error to get a better message
2388
+ var errMsg = err.message
2389
+ ? err.message
2390
+ : err.status
2391
+ ? err.status + " - " + err.statusText
2392
+ : "Server error";
2393
+ console.error(errMsg); // log to console instead
2394
+ throw err;
2395
+ }));
2396
+ };
2397
+ FileService.ctorParameters = function () { return [
2398
+ { type: http.HttpClient },
2399
+ { type: AppService },
2400
+ { type: ngxToastr.ToastrService }
2401
+ ]; };
2402
+ FileService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function FileService_Factory() { return new FileService(core["ɵɵinject"](http.HttpClient), core["ɵɵinject"](AppService), core["ɵɵinject"](ngxToastr.ToastrService)); }, token: FileService, providedIn: "root" });
2403
+ FileService = __decorate([
2404
+ core.Injectable({
2405
+ providedIn: "root",
2406
+ }),
2407
+ __metadata("design:paramtypes", [http.HttpClient,
2408
+ AppService,
2409
+ ngxToastr.ToastrService])
2410
+ ], FileService);
2411
+ return FileService;
2412
+ }());
2413
+
2414
+ var FHUploadPanelS3Component = /** @class */ (function () {
2415
+ function FHUploadPanelS3Component(_appservice, _dataService, toastr, dialog, fileService, uti) {
2416
+ this._appservice = _appservice;
2417
+ this._dataService = _dataService;
2418
+ this.toastr = toastr;
2419
+ this.dialog = dialog;
2420
+ this.fileService = fileService;
2421
+ this.uti = uti;
2422
+ this.enabled = true;
2423
+ this.force_en = false;
2424
+ this.label = "";
2425
+ this.sovrascrivi_path = "";
2426
+ this.ruolo_supervisore = "[ZZZ_DIS_CC]";
2427
+ this.access_control = false;
2428
+ this.show_images = true;
2429
+ this.can_delete_owner = true;
2430
+ this.b_initt = false;
2431
+ this.change = new core.EventEmitter();
2432
+ this.call_upload = new core.EventEmitter();
2433
+ this.image_mode = false;
2434
+ this.App = "";
2435
+ this.K = "";
2436
+ this.image_type = false;
2437
+ this.b_edit_loaded = false;
2438
+ this.b_False = false;
2439
+ this.b_mobile = false;
2440
+ this.b_ini = false;
2441
+ this.m_p_tipo = '';
2442
+ this.multi_list = false;
2443
+ this.m_programma_da_eseguire = '';
2444
+ this.m_p_cod_doc = '';
2445
+ this.m_p_section = '';
2446
+ this.m_p_system_type = '';
2447
+ }
2448
+ FHUploadPanelS3Component.prototype.call_up = function (o) {
2449
+ this.call_upload.emit({
2450
+ App: this.App,
2451
+ K: this.K,
2452
+ descrizione: o.descrizione,
2453
+ single: false,
2454
+ username: this._appservice.user,
2455
+ cod_doc: this.m_p_cod_doc,
2456
+ section: this.m_p_section,
2457
+ local_path: this._appservice.LOCAL_PATH,
2458
+ p1: this.m_programma_da_eseguire,
2459
+ });
2460
+ };
2461
+ FHUploadPanelS3Component.prototype.download_all = function (ax) {
2462
+ var _this = this;
2463
+ var p = new FSInput();
2464
+ p.command = "exec_app";
2465
+ p.p1 = "s3_downloader";
2466
+ p.p2 = ax.uiid +
2467
+ "|" +
2468
+ this._appservice.user;
2469
+ this.fileService.doQuery(p).subscribe(function (data) {
2470
+ if (data != null)
2471
+ if (data.result_msg == "OK") {
2472
+ var str_mg = data.msg.split('|');
2473
+ if (str_mg[0] == 'OK')
2474
+ window.open(str_mg[1]);
2475
+ else
2476
+ _this.toastr.error(str_mg[1].split('|').join(' -> '));
2477
+ }
2478
+ });
2479
+ };
2480
+ FHUploadPanelS3Component.prototype.edit_tipo = function (ax) {
2481
+ var _this = this;
2482
+ var p = new QParam();
2483
+ p.sql = this.m_p_tipo;
2484
+ p.types = [];
2485
+ p.values = [];
2486
+ this._dataService.doQuery(p).subscribe(function (data) {
2487
+ if (data != null)
2488
+ if (data.result_msg == "OK") {
2489
+ var dialogRef_1 = _this.dialog.open(FHWinComboSelect);
2490
+ setTimeout(function () {
2491
+ dialogRef_1.componentInstance.set_selection("Tipologia Allegato", data.result_data);
2492
+ });
2493
+ dialogRef_1.afterClosed().subscribe(function (result) {
2494
+ if (result != null) {
2495
+ var p_1 = new QParam();
2496
+ p_1.sql = "UPDATE_ALLEGATI_TIPO";
2497
+ p_1.types = ["int", "string"];
2498
+ p_1.values = [ax.id, result.descrizione_valore];
2499
+ _this._dataService.doQuery(p_1).subscribe(function (data) {
2500
+ if (data != null)
2501
+ if (data.result_msg == "OK") {
2502
+ _this.ref_allegato();
2503
+ }
2504
+ });
2505
+ }
2506
+ });
2507
+ }
2508
+ });
2509
+ };
2510
+ FHUploadPanelS3Component.prototype.edit_descri = function (ax) {
2511
+ var _this = this;
2512
+ var dialogRef = this.dialog.open(WinAskTextBigComponent);
2513
+ setTimeout(function () {
2514
+ dialogRef.componentInstance.label = "Descrizione Allegato";
2515
+ dialogRef.componentInstance.valore = ax.description;
2516
+ dialogRef.componentInstance.min_chars = 0;
2517
+ });
2518
+ dialogRef.afterClosed().subscribe(function (result) {
2519
+ if (result != null) {
2520
+ var p = new QParam();
2521
+ p.sql = "UPDATE_ALLEGATI_DESCRIZIONE_NEW";
2522
+ p.types = ["string", 'string'];
2523
+ p.values = [ax.uiid, result];
2524
+ _this._dataService.doQuery(p).subscribe(function (data) {
2525
+ if (data != null)
2526
+ if (data.result_msg == "OK") {
2527
+ _this.ref_allegato();
2528
+ }
2529
+ });
2530
+ }
2531
+ });
2532
+ };
2533
+ FHUploadPanelS3Component.prototype.delete = function (ax) {
2534
+ var _this = this;
2535
+ localStorage.setItem(this._appservice.COMPANY_KEY + "title_dialog", "Conferma Operazione");
2536
+ localStorage.setItem(this._appservice.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
2537
+ var dialogRef = this.dialog.open(FHConfirmComponent);
2538
+ dialogRef.afterClosed().subscribe(function (result) {
2539
+ if (result) {
2540
+ var p = new QParam();
2541
+ p.sql = "DELETE_ALLEGATO_NEW";
2542
+ p.types = ["string"];
2543
+ p.values = [ax.uiid];
2544
+ _this._dataService.doQuery(p).subscribe(function (data) {
2545
+ if (data != null)
2546
+ if (data.result_msg == "OK") {
2547
+ // this.arr_g = data.result_data;
2548
+ _this.ref_allegato();
2549
+ _this.toastr.info("INFO", "ALLEGATO ELIMINATO", {
2550
+ timeOut: 1000,
2551
+ progressBar: true,
2552
+ });
2553
+ }
2554
+ });
2555
+ }
2556
+ });
2557
+ };
2558
+ FHUploadPanelS3Component.prototype.ngAfterViewInit = function () {
2559
+ var _this = this;
2560
+ setTimeout(function () {
2561
+ setTimeout(function () {
2562
+ _this.b_initt = true;
2563
+ }, 700);
2564
+ _this.upc.single = false;
2565
+ _this.b_mobile = _this._appservice.getState().pageFullscreen;
2566
+ if (_this.force_en)
2567
+ _this.upc.init(_this.App, _this.K, _this.m_p_cod_doc, _this.m_p_section, 'Attachment Description', _this.m_p_system_type, _this.m_programma_da_eseguire);
2568
+ else
2569
+ _this.upc.init(_this.App, _this.K, _this.m_p_cod_doc, _this.m_p_section, 'Descrizione Allegato', _this.m_p_system_type, _this.m_programma_da_eseguire);
2570
+ _this.ref_allegato();
2571
+ });
2572
+ };
2573
+ FHUploadPanelS3Component.prototype.init = function (p_app, p_k, p_cod_doc, p_section, p_system_type, programma_da_eseguire) {
2574
+ if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
2575
+ this.App = p_app;
2576
+ this.K = p_k;
2577
+ this.b_ini = true;
2578
+ this.b_edit_loaded = false;
2579
+ this.m_p_cod_doc = p_cod_doc;
2580
+ this.m_p_section = p_section;
2581
+ this.m_p_system_type = p_system_type;
2582
+ this.m_programma_da_eseguire = programma_da_eseguire;
2583
+ this.ngAfterViewInit();
2584
+ };
2585
+ FHUploadPanelS3Component.prototype.ref_allegato = function () {
2586
+ var _this = this;
2587
+ if (this.App == null)
2588
+ return;
2589
+ if (this.App == "")
2590
+ return;
2591
+ this.image_mode = false;
2592
+ var p = new QParam();
2593
+ p.sql = "SELECT_ALLEGATO_INFO_NEW";
2594
+ p.types = ["string", "string", "string"];
2595
+ p.values = [this.App, this.K, this.m_p_section];
2596
+ this._dataService.doQuery(p).subscribe(function (data) {
2597
+ if (data != null)
2598
+ if (data.result_msg == "OK") {
2599
+ _this.arr_g = data.result_data;
2600
+ _this.arr_g.map(function (v) { if (v.type == 'IMG')
2601
+ _this.image_mode = true; });
2602
+ var iconf = "webinfo";
2603
+ for (var i = 0; i < _this.arr_g.length; i++) {
2604
+ if (_this.arr_g[i].APP != null)
2605
+ _this.arr_g[i].App = _this.arr_g[i].APP;
2606
+ if (_this.arr_g[i].description != null)
2607
+ _this.arr_g[i].descrizione_vis = _this.arr_g[i].description
2608
+ .split("\n")
2609
+ .join("<br>");
2610
+ else
2611
+ _this.arr_g[i].descrizione_vis = '';
2612
+ var arrf = _this.arr_g[i].file_name_orig.split(".");
2613
+ if (_this.sovrascrivi_path == "") {
2614
+ _this.arr_g[i].url =
2615
+ _this._appservice.COMPANY_SITE_ROOT +
2616
+ "/uploads/" +
2617
+ _this.arr_g[i].App +
2618
+ "/" +
2619
+ _this.arr_g[i].K +
2620
+ "/" +
2621
+ _this.arr_g[i].file_name_orig;
2622
+ _this.arr_g[i].url_orig =
2623
+ _this._appservice.COMPANY_SITE_ROOT +
2624
+ "/uploads/" +
2625
+ _this.arr_g[i].App +
2626
+ "/" +
2627
+ _this.arr_g[i].K +
2628
+ "/" +
2629
+ _this.arr_g[i].file_name_orig;
2630
+ }
2631
+ else {
2632
+ _this.arr_g[i].url =
2633
+ _this.sovrascrivi_path +
2634
+ "/uploads/" +
2635
+ _this.arr_g[i].App +
2636
+ "/" +
2637
+ _this.arr_g[i].K +
2638
+ "/" +
2639
+ _this.arr_g[i].file_name_orig;
2640
+ _this.arr_g[i].url_orig =
2641
+ _this.sovrascrivi_path +
2642
+ "/uploads/" +
2643
+ _this.arr_g[i].App +
2644
+ "/" +
2645
+ _this.arr_g[i].K +
2646
+ "/" +
2647
+ _this.arr_g[i].file_name_orig;
2648
+ }
2649
+ if ("3G2|3GA|3GP|7Z|AA|AAC|AC|ACCDB|ACCDT|ADN|AI|AIF|AIFC|AIFF|AIT|AMR|ANI|APK|APP|APPLESCRIPT|ASAX|ASC|ASCX|ASF|ASH|ASHX|ASMX|ASP|ASPX|ASX|AU|AUP|AVI|AXD|AZE|BAK|BASH|BAT|BIN|BLANK|BMP|BOWERRC|BPG|BROWSER|BZ2|C|CAB|CAD|CAF|CAL|CD|CER|CFG|CFM|CFML|CGI|CLASS|CMD|CODEKIT|COFFEE|COFFEELINTIGNORE|COM|COMPILE|CONF|CONFIG|CPP|CPTX|CR2|CRDOWNLOAD|CRT|CRYPT|CS|CSH|CSON|CSPROJ|CSS|CSV|CUE|DAT|DB|DBF|DEB|DGN|DIST|DIZ|DLL|DMG|DNG|DOC|DOCB|DOCM|DOCX|DOT|DOTM|DOTX|DOWNLOAD|DPJ|DS_STORE|DTD|DWG|DXF|EDITORCONFIG|EL|ENC|EOT|EPS|EPUB|ESLINTIGNORE|EXE|F4V|FAX|FB2|FLA|FLAC|FLV|FOLDER|GADGET|GDP|GEM|GIF|GITATTRIBUTES|GITIGNORE|GO|GPG|GZ|H|HANDLEBARS|HBS|HEIC|HS|HSL|HTM|HTML|IBOOKS|ICNS|ICO|ICS|IDX|IFF|IFO|IMAGE|IMG|IN|INDD|INF|INI|ISO|J2|JAR|JAVA|JPE|JPEG|JPG|JS|JSON|JSP|JSX|KEY|KF8|KMK|KSH|KUP|LESS|LEX|LICX|LISP|LIT|LNK|LOCK|LOG|LUA|M|M2V|M3U|M3U8|M4|M4A|M4R|M4V|MAP|MASTER|MC|MD|MDB|MDF|ME|MI|MID|MIDI|MK|MKV|MM|MO|MOBI|MOD|MOV|MP2|MP3|MP4|MPA|MPD|MPE|MPEG|MPG|MPGA|MPP|MPT|MSI|MSU|NEF|NES|NFO|NIX|NPMIGNORE|ODB|ODS|ODT|OGG|OGV|OST|OTF|OTT|OVA|OVF|P12|P7B|PAGES|PART|PCD|PDB|PDF|PEM|PFX|PGP|PH|PHAR|PHP|PKG|PL|PLIST|PM|PNG|PO|POM|POT|POTX|PPS|PPSX|PPT|PPTM|PPTX|PROP|PS|PS1|PSD|PSP|PST|PUB|PY|PYC|QT|RA|RAM|RAR|RAW|RB|RDF|RESX|RETRY|RM|ROM|RPM|RSA|RSS|RTF|RU|RUB|SASS|SCSS|SDF|SED|SH|SITEMAP|SKIN|SLDM|SLDX|SLN|SOL|SQL|SQLITE|STEP|STL|SVG|SWD|SWF|SWIFT|SYS|TAR|TCSH|TEX|TFIGNORE|TGA|TGZ|TIF|TIFF|TMP|TORRENT|TS|TSV|TTF|TWIG|TXT|UDF|VB|VBPROJ|VBS|VCD|VCS|VDI|VDX|VMDK|VOB|VSCODEIGNORE|VSD|VSS|VST|VSX|VTX|WAR|WAV|WBK|WEBINFO|WEBM|WEBP|WMA|WMF|WMV|WOFF|WOFF2|WPS|WSF|XAML|XCF|XLM|XLS|XLSM|XLSX|XLT|XLTM|XLTX|XML|XPI|XPS|XRB|XSD|XSL|XSPF|XZ|YAML|YML|Z|ZIP|ZSH".indexOf(arrf[arrf.length - 1].toLocaleUpperCase()) != -1)
2650
+ iconf = arrf[arrf.length - 1].toLocaleLowerCase();
2651
+ _this.arr_g[i].icon = iconf + ".svg";
2652
+ if (_this.can_delete_owner) {
2653
+ _this.arr_g[i].can_delete =
2654
+ !_this.access_control ||
2655
+ _this.arr_g[i].idp == _this._appservice.user ||
2656
+ _this.uti.hasRole(_this.ruolo_supervisore);
2657
+ if ("[ZZZ_DIS_CC]" == _this.ruolo_supervisore)
2658
+ _this.arr_g[i].can_delete_m = _this.arr_g[i].idp;
2659
+ else
2660
+ _this.arr_g[i].can_delete_m =
2661
+ _this.arr_g[i].idp + ",[" + _this.ruolo_supervisore + "]";
2662
+ }
2663
+ else {
2664
+ _this.arr_g[i].can_delete =
2665
+ !_this.access_control ||
2666
+ _this.uti.hasRole(_this.ruolo_supervisore);
2667
+ if ("[ZZZ_DIS_CC]" == _this.ruolo_supervisore)
2668
+ _this.arr_g[i].can_delete_m = "";
2669
+ else
2670
+ _this.arr_g[i].can_delete_m = "[" + _this.ruolo_supervisore + "]";
2671
+ }
2672
+ _this.arr_g[i].can_edit =
2673
+ !_this.access_control ||
2674
+ _this.arr_g[i].idp == _this._appservice.user ||
2675
+ _this.uti.hasRole(_this.ruolo_supervisore);
2676
+ if ((_this.arr_g[i].file_name_orig.indexOf(".jpg") != -1 ||
2677
+ _this.arr_g[i].file_name_orig.indexOf(".gif") != -1 ||
2678
+ _this.arr_g[i].file_name_orig.indexOf(".png") != -1) &&
2679
+ _this.show_images) {
2680
+ _this.arr_g[i].type = "IMG";
2681
+ _this.arr_g[i].image_original = [_this.arr_g[i].url];
2682
+ if (_this.arr_g[i].preview != null)
2683
+ if (_this.arr_g[i].preview == 1) {
2684
+ var pcs = _this.arr_g[i].url.split(".");
2685
+ var lastPc = pcs.pop();
2686
+ _this.arr_g[i].url = pcs.join(".") + "_preview." + lastPc;
2687
+ }
2688
+ _this.image_type = true;
2689
+ _this.arr_g[i].image_thumbnail = [_this.arr_g[i].url];
2690
+ }
2691
+ else
2692
+ _this.arr_g[i].type = "O";
2693
+ }
2694
+ }
1726
2695
  });
1727
2696
  };
1728
- FHListComponent.prototype.sc = function () {
1729
- this.selchange.emit();
1730
- };
1731
- FHListComponent.ctorParameters = function () { return [
1732
- { type: QueryService }
2697
+ FHUploadPanelS3Component.ctorParameters = function () { return [
2698
+ { type: AppService },
2699
+ { type: QueryService },
2700
+ { type: ngxToastr.ToastrService },
2701
+ { type: dialog.MatDialog },
2702
+ { type: FileService },
2703
+ { type: UtilityService }
1733
2704
  ]; };
1734
2705
  __decorate([
1735
2706
  core.Input(),
1736
2707
  __metadata("design:type", Boolean)
1737
- ], FHListComponent.prototype, "init_fill", void 0);
2708
+ ], FHUploadPanelS3Component.prototype, "enabled", void 0);
1738
2709
  __decorate([
1739
2710
  core.Input(),
1740
- __metadata("design:type", String)
1741
- ], FHListComponent.prototype, "sql", void 0);
2711
+ __metadata("design:type", Boolean)
2712
+ ], FHUploadPanelS3Component.prototype, "force_en", void 0);
1742
2713
  __decorate([
1743
2714
  core.Input(),
1744
- __metadata("design:type", Array)
1745
- ], FHListComponent.prototype, "types", void 0);
2715
+ __metadata("design:type", String)
2716
+ ], FHUploadPanelS3Component.prototype, "label", void 0);
1746
2717
  __decorate([
1747
2718
  core.Input(),
1748
- __metadata("design:type", Array)
1749
- ], FHListComponent.prototype, "values", void 0);
2719
+ __metadata("design:type", String)
2720
+ ], FHUploadPanelS3Component.prototype, "sovrascrivi_path", void 0);
1750
2721
  __decorate([
1751
2722
  core.Input(),
1752
2723
  __metadata("design:type", String)
1753
- ], FHListComponent.prototype, "label", void 0);
2724
+ ], FHUploadPanelS3Component.prototype, "ruolo_supervisore", void 0);
1754
2725
  __decorate([
1755
2726
  core.Input(),
1756
2727
  __metadata("design:type", Boolean)
1757
- ], FHListComponent.prototype, "enabled", void 0);
2728
+ ], FHUploadPanelS3Component.prototype, "access_control", void 0);
1758
2729
  __decorate([
1759
2730
  core.Input(),
1760
2731
  __metadata("design:type", Boolean)
1761
- ], FHListComponent.prototype, "single_sel", void 0);
2732
+ ], FHUploadPanelS3Component.prototype, "show_images", void 0);
1762
2733
  __decorate([
1763
2734
  core.Input(),
1764
- __metadata("design:type", String)
1765
- ], FHListComponent.prototype, "separator", void 0);
1766
- __decorate([
1767
- core.ViewChild("cmb"),
1768
- __metadata("design:type", core.ElementRef)
1769
- ], FHListComponent.prototype, "smtr", void 0);
2735
+ __metadata("design:type", Boolean)
2736
+ ], FHUploadPanelS3Component.prototype, "can_delete_owner", void 0);
1770
2737
  __decorate([
1771
2738
  core.Output(),
1772
2739
  __metadata("design:type", core.EventEmitter)
1773
- ], FHListComponent.prototype, "fillend", void 0);
2740
+ ], FHUploadPanelS3Component.prototype, "change", void 0);
1774
2741
  __decorate([
1775
2742
  core.Output(),
1776
2743
  __metadata("design:type", core.EventEmitter)
1777
- ], FHListComponent.prototype, "selchange", void 0);
2744
+ ], FHUploadPanelS3Component.prototype, "call_upload", void 0);
1778
2745
  __decorate([
1779
- core.Output(),
1780
- __metadata("design:type", core.EventEmitter)
1781
- ], FHListComponent.prototype, "initend", void 0);
1782
- FHListComponent = __decorate([
2746
+ core.ViewChild("upc"),
2747
+ __metadata("design:type", FHUploadS3Component)
2748
+ ], FHUploadPanelS3Component.prototype, "upc", void 0);
2749
+ FHUploadPanelS3Component = __decorate([
1783
2750
  core.Component({
1784
- selector: "FHList",
1785
- template: "\n <table class=\"fh_table\" style=\"width:100%;\">\n <thead>\n <tr>\n <th *ngIf=\"!single_sel\"></th>\n <th>\n {{ label }}\n </th>\n <th *ngIf=\"single_sel\"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let u of myData; let odd = odd; let even = even\"\n [ngClass]=\"{ odd: odd, even: even }\"\n >\n <td style=\"width:20px;\" valign=\"middle\" *ngIf=\"!single_sel\">\n <mat-slide-toggle\n (change)=\"upd_f(u, $event)\"\n [disabled]=\"!enabled\"\n [(ngModel)]=\"u.checked\"\n ></mat-slide-toggle>\n </td>\n <td (click)=\"change_v(u, $event)\" valign=\"middle\">\n {{ u.descrizione_valore }}\n </td>\n <td\n valign=\"middle\"\n style=\"width:20px;text-align: center\"\n *ngIf=\"single_sel\"\n >\n <button\n mat-flat-button\n color=\"primary\"\n (click)=\"upd_f(u, $event)\"\n [disabled]=\"!enabled\"\n >\n <mat-icon>send</mat-icon></button\n >&nbsp;&nbsp;&nbsp;\n </td>\n </tr>\n </tbody>\n </table>\n ",
2751
+ selector: "FHUploadPanelS3",
2752
+ template: "\n UPLOADPANEL {{m_p_section}}\n <div fxLayout=\"column\">\n <h3 *ngIf=\"label != ''\">{{ label }}</h3>\n <div fxLayout=\"column\">\n <div [hidden]=\"!enabled\">\n {{m_p_section}}\n <FHUploadS3\n [single]=\"b_False\"\n [label_attendere]=\"\n force_en ? 'UPLOADING' : 'ATTENDERE UPLOAD IN CORSO'\n \"\n [fixed_label]=\"\n force_en\n ? 'Attachments description (insert the description here before uploading the file)'\n : ' (INSERISCI QUI LA DESCRIZIONE PRIMA DI CARICARE IL FILE)'\n \"\n [allegato_inserito]=\"\n force_en ? 'Attachment Inserted' : 'ALLEGATO INSERITO'\n \"\n [lista_allegati]=\"arr_g\"\n (change)=\"ref_allegato()\"\n (call_upload)=\"call_up($event)\"\n #upc\n ></FHUploadS3>\n </div>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"!image_type && !b_mobile\">\n <thead>\n <tr class=\"header\">\n <th style=\"width:40px\"></th>\n <th style=\"width:50%\">{{ force_en ? \"Name\" : \"Nome\" }}</th>\n <th style=\"width:60px;text-align:center\">Dim.</th>\n <th style=\"width:40%\">\n {{ force_en ? \"Description\" : \"Descrizione\" }}\n </th>\n <th style=\"width:20%\">\n {{ force_en ? \"Version\" : \"Versione\" }}\n </th>\n\n <th *ngIf=\"image_mode\" class=\"actions\"></th>\n <th style=\"width:30%\">{{ force_en ? \"User\" : \"Utente\" }}</th>\n <th style=\"width:240px;text-align:center\">\n {{ force_en ? \"Date\" : \"Data\" }}\n </th>\n <th style=\"width:40px\" class=\"actions\"></th>\n <th *ngIf=\"enabled\" style=\"width:40px\" class=\"actions\"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let app of arr_g; let odd = odd; let even = even\"\n style=\"font-size: 15px;\"\n [ngClass]=\"{ odd: odd, even: even }\"\n >\n <td\n style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\"\n >\n <div\n style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\"\n >\n <img\n src=\"assets/icons/square-o/{{ app.icon }}\"\n style=\"width:28px;height:28px;\"\n />\n </div>\n </td>\n <td>{{ app.file_name_orig }}</td>\n <td style=\"text-align:center\">{{ app.dim }}</td>\n <td>\n <div fxLayout=\"row\">\n <div *ngIf=\"enabled\">\n <a\n mat-icon-button\n matTooltip=\"Modifica Descrizione\"\n *ngIf=\"app.can_edit\"\n (click)=\"edit_descri(app)\"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]=\"\n 'Modifica Descrizione consentita solo a: ' + app.nc\n \"\n *ngIf=\"!app.can_edit\"\n [disabled]=\"true\"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]=\"app.descrizione_vis\"\n style=\"width:100%\"\n ></div>\n </div>\n </td>\n\n <td>\n {{app.version}}\n </td>\n\n <td *ngIf=\"image_mode\"\n style=\"min-width:400px;min-height: 400px\"\n\n >\n <fh-image-viewer [u]=\"app\"></fh-image-viewer>\n </td>\n\n <td>{{ app.nc }}</td>\n <td style=\"text-align:center\">\n {{ app.dt_ins | date: \"dd/MM/yyyy HH:mm:ss\" }}\n </td>\n <td style=\"text-align:center\">\n <button\n mat-icon-button\n matTooltip=\"Download File\"\n (click)=\"download_all(app)\"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf=\"enabled\" style=\"text-align:center\">\n <a\n mat-icon-button\n matTooltip=\"Elimina File\"\n *ngIf=\"app.can_delete\"\n (click)=\"delete(app)\"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]=\"\n 'Cancellazione consentita solo a: ' + app.can_delete_m\n \"\n *ngIf=\"!app.can_delete\"\n [disabled]=\"true\"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"image_type && !b_mobile\">\n <thead>\n <tr class=\"header\">\n <th style=\"width:40px\"></th>\n <th style=\"width:50%\">{{ force_en ? \"Name\" : \"Nome\" }}</th>\n <th style=\"width:60px;text-align:center\">Dim.</th>\n\n <th style=\"width:20%\">\n {{ force_en ? \"Description\" : \"Descrizione\" }}\n </th>\n <th *ngIf=\"multi_list\" style=\"width:10%\">\n {{ force_en ? \"Version\" : \"Versione\" }}\n </th>\n <th style=\"width:40%\"></th>\n\n <th style=\"width:10%\">{{ force_en ? \"User\" : \"Utente\" }}</th>\n <th style=\"width:240px;text-align:center\">\n {{ force_en ? \"Date\" : \"Data\" }}\n </th>\n <th style=\"width:40px\" class=\"actions\"></th>\n <th *ngIf=\"enabled\" style=\"width:40px\" class=\"actions\"></th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let app of arr_g; let odd = odd; let even = even\"\n style=\"font-size: 15px;\"\n [ngClass]=\"{ odd: odd, even: even }\"\n >\n <td\n style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\"\n >\n <div\n style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\"\n >\n <img\n src=\"assets/icons/square-o/{{ app.icon }}\"\n style=\"width:28px;height:28px;\"\n />\n </div>\n </td>\n\n <td>{{ app.file_name_orig }}</td>\n <td style=\"text-align:center\">{{ app.dim }}</td>\n <td>\n <div fxLayout=\"row\">\n <div *ngIf=\"enabled\">\n <a\n mat-icon-button\n matTooltip=\"Modifica Descrizione\"\n *ngIf=\"app.can_edit\"\n (click)=\"edit_descri(app)\"\n >\n <mat-icon>edit</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]=\"\n 'Modifica Descrizione consentita solo a: ' + app.nc\n \"\n *ngIf=\"!app.can_edit\"\n [disabled]=\"true\"\n >\n <mat-icon>edit</mat-icon>\n </a>\n </div>\n <div\n [innerHTML]=\"app.descrizione_vis\"\n style=\"width:100%\"\n ></div>\n </div>\n </td>\n <td>\n {{app.version}}\n </td>\n\n <td\n style=\"min-width:400px;min-height: 400px\"\n *ngIf=\"app.type == 'IMG'\"\n >\n <fh-image-viewer [u]=\"app\"></fh-image-viewer>\n </td>\n <td *ngIf=\"app.type != 'IMG'\"></td>\n <td>{{ app.nc }}</td>\n <td style=\"text-align:center\">\n {{ app.dt_ins | date: \"dd/MM/yyyy HH:mm:ss\" }}\n </td>\n <td style=\"text-align:center\">\n <button\n mat-icon-button\n matTooltip=\"Download File\"\n (click)=\"download_all(app)\"\n >\n <mat-icon>cloud_download</mat-icon>\n </button>\n </td>\n\n <td *ngIf=\"enabled\" style=\"text-align:center\">\n <a\n mat-icon-button\n matTooltip=\"Elimina File\"\n *ngIf=\"app.can_delete\"\n (click)=\"delete(app)\"\n >\n <mat-icon>delete</mat-icon>\n </a>\n\n <a\n mat-icon-button\n [matTooltip]=\"\n 'Cancellazione consentita solo a: ' + app.can_delete_m\n \"\n *ngIf=\"!app.can_delete\"\n [disabled]=\"true\"\n >\n <mat-icon>delete</mat-icon>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n <table width=\"98%\" class=\"fh_table\" *ngIf=\"b_mobile\">\n <tbody>\n <tr\n *ngFor=\"let app of arr_g; let odd = odd; let even = even\"\n style=\"font-size: 15px;\"\n [ngClass]=\"{ odd: odd, even: even }\"\n >\n <td\n style=\"text-align:center;vertical-align: middle;width:36px;height:36px;\"\n >\n <div\n style=\"text-align:center;vertical-align: middle;width:28px;height:28px;\"\n >\n <img\n src=\"assets/icons/square-o/{{ app.icon }}\"\n style=\"width:28px;height:28px;\"\n />\n </div>\n </td>\n <td *ngIf=\"b_mobile\" style=\"text-align:center\">\n {{ app.file_name_orig }}<br /><br />\n <button\n style=\"background-color: #F5F5F5\"\n (click)=\"download_all(app)\"\n mat-flat-button\n >\n DOWNLOAD\n </button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div *ngIf=\"!b_ini && b_initt\" style=\"color:#ff0000\">\n\n </div>\n ",
1786
2753
  styles: [""]
1787
2754
  }),
1788
- __metadata("design:paramtypes", [QueryService])
1789
- ], FHListComponent);
1790
- return FHListComponent;
2755
+ __metadata("design:paramtypes", [AppService,
2756
+ QueryService,
2757
+ ngxToastr.ToastrService,
2758
+ dialog.MatDialog,
2759
+ FileService,
2760
+ UtilityService])
2761
+ ], FHUploadPanelS3Component);
2762
+ return FHUploadPanelS3Component;
1791
2763
  }());
1792
2764
 
1793
- var WinWait = /** @class */ (function () {
1794
- function WinWait(dialogRef, data) {
2765
+ var FHPickListComponent = /** @class */ (function () {
2766
+ function FHPickListComponent(dialogRef, _dataService, toastr, data) {
1795
2767
  this.dialogRef = dialogRef;
1796
- this.data = data;
1797
- this.label = "";
1798
- this.progress_p = 0;
1799
- if (data != null) {
1800
- if (data.label != null)
1801
- this.label = data.label;
1802
- if (data.progress_p != null)
1803
- this.progress_p = data.progress_p;
1804
- }
1805
- }
1806
- WinWait.prototype.close = function () {
1807
- this.dialogRef.close(null);
1808
- };
1809
- WinWait.prototype.update_progess = function (p) {
1810
- this.progress_p = p;
1811
- if (p == 100)
1812
- this.dialogRef.close();
1813
- };
1814
- WinWait.prototype.ngAfterViewInit = function () { };
1815
- WinWait.ctorParameters = function () { return [
1816
- { type: dialog.MatDialogRef },
1817
- { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
1818
- ]; };
1819
- __decorate([
1820
- core.ViewChild("cmb_sel"),
1821
- __metadata("design:type", FHListComponent)
1822
- ], WinWait.prototype, "cmb_sel", void 0);
1823
- WinWait = __decorate([
1824
- core.Component({
1825
- selector: "fhwinwait",
1826
- template: "\n <h2 mat-dialog-title>\n {{ label | uppercase }}\n </h2>\n <mat-dialog-content style=\"min-width:700px\">\n <mat-progress-bar\n style=\"height:50px\"\n color=\"accent\"\n mode=\"determinate\"\n value=\"{{ progress_p }}\"\n ></mat-progress-bar>\n </mat-dialog-content>\n "
1827
- }),
1828
- __param(1, core.Inject(dialog.MAT_DIALOG_DATA)),
1829
- __metadata("design:paramtypes", [dialog.MatDialogRef, Object])
1830
- ], WinWait);
1831
- return WinWait;
1832
- }());
1833
-
1834
- var OdbcService = /** @class */ (function () {
1835
- function OdbcService(http, app_s, toastr) {
1836
- this.http = http;
1837
- this.app_s = app_s;
1838
- this.toastr = toastr;
1839
- this.url = this.app_s.API_ENDPOINT + this.app_s.ODBC_ENDPOINT; // URL to web API
1840
- }
1841
- OdbcService.prototype.doQuery = function (queryp, displayError) {
1842
- var _this = this;
1843
- if (displayError === void 0) { displayError = true; }
1844
- this.headers = new http.HttpHeaders({
1845
- "Content-Type": "application/json",
1846
- Authorization: "Bearer " + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
1847
- });
1848
- this.url = this.app_s.API_ENDPOINT + this.app_s.ODBC_ENDPOINT;
1849
- var post_v = JSON.stringify(queryp);
1850
- return this.http.post(this.url, post_v, { headers: this.headers }).pipe(operators.map(function (res) {
1851
- // Handle errors, display if enabled
1852
- var err;
1853
- if (!res) {
1854
- err = new Error("Empty server response");
1855
- }
1856
- else if (res.result_msg === "KO") {
1857
- err = new Error(res.msg);
1858
- }
1859
- if (err) {
1860
- console.error(err);
1861
- if (displayError) {
1862
- _this.toastr.error(err.message);
1863
- }
1864
- throw new Error(err);
1865
- }
1866
- return res || new QGResult();
1867
- }), operators.catchError(function (err) {
1868
- // In a real world app, we might use a remote logging infrastructure
1869
- // We'd also dig deeper into the error to get a better message
1870
- var errMsg = err.message
1871
- ? err.message
1872
- : err.status
1873
- ? err.status + " - " + err.statusText
1874
- : "Server error";
1875
- console.error(errMsg); // log to console instead
1876
- throw err;
1877
- }));
1878
- };
1879
- OdbcService.ctorParameters = function () { return [
1880
- { type: http.HttpClient },
1881
- { type: AppService },
1882
- { type: ngxToastr.ToastrService }
1883
- ]; };
1884
- OdbcService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function OdbcService_Factory() { return new OdbcService(core["ɵɵinject"](http.HttpClient), core["ɵɵinject"](AppService), core["ɵɵinject"](ngxToastr.ToastrService)); }, token: OdbcService, providedIn: "root" });
1885
- OdbcService = __decorate([
1886
- core.Injectable({
1887
- providedIn: "root",
1888
- }),
1889
- __metadata("design:paramtypes", [http.HttpClient,
1890
- AppService,
1891
- ngxToastr.ToastrService])
1892
- ], OdbcService);
1893
- return OdbcService;
1894
- }());
1895
-
1896
- var noop = function () { };
1897
- var ɵ0 = noop;
1898
- var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1 = {
1899
- provide: forms.NG_VALUE_ACCESSOR,
1900
- useExisting: core.forwardRef(function () { return FHComboboxComponent; }),
1901
- multi: true,
1902
- };
1903
- var FHComboboxComponent = /** @class */ (function () {
1904
- function FHComboboxComponent(_dataService, _dataService_odbc) {
1905
2768
  this._dataService = _dataService;
1906
- this._dataService_odbc = _dataService_odbc;
1907
- this.init_fill = true;
1908
- this.sql = "";
1909
- this.types = [];
1910
- this.values = [];
1911
- this.hidden = false;
1912
- this.label = "";
1913
- this.enabled = true;
1914
- this.required = false;
1915
- this.sel_label = "";
1916
- this.fillend = new core.EventEmitter();
1917
- this.selchange = new core.EventEmitter();
1918
- this.initend = new core.EventEmitter();
1919
- this.myData = [];
1920
- this.valDef = "-1";
2769
+ this.toastr = toastr;
2770
+ this.data = data;
2771
+ this.width = "100%";
2772
+ this.selectedAdd = null;
2773
+ this.selectedRemove = null;
1921
2774
  this.selval = "-1";
1922
2775
  this.errorMsg = "";
1923
- this.db_type = "1";
1924
- this.dis_value = "";
1925
- this.descri_val = "";
1926
- this.onChange = function (_) { };
1927
- this.onTouched = function () { };
2776
+ this.valDef = "-1";
2777
+ this.fltr_user = "";
2778
+ this.value_list = new Array();
2779
+ this.single_sel = false;
2780
+ this.vis_buttons = true;
2781
+ this.limit_size = false;
2782
+ this.value_list_sel = new Array();
2783
+ this.types = [];
2784
+ this.values = [];
2785
+ this.value_sel = [];
2786
+ if (data != null) {
2787
+ if (data.value_list != null)
2788
+ this.value_list = data.value_list;
2789
+ if (data.single_sel != null)
2790
+ this.single_sel = data.single_sel;
2791
+ if (data.vis_buttons != null)
2792
+ this.vis_buttons = data.vis_buttons;
2793
+ if (data.limit_size != null)
2794
+ this.limit_size = data.limit_size;
2795
+ if (data.value_sel != null)
2796
+ this.value_sel = data.value_sel;
2797
+ this.fill_list_arr(this.value_list, this.value_sel);
2798
+ }
1928
2799
  }
1929
- FHComboboxComponent.prototype.setValue = function (desc_val) {
1930
- this.setByValue(desc_val);
1931
- };
1932
- FHComboboxComponent.prototype.update_dis = function () {
1933
- this.dis_value = "";
1934
- try {
1935
- if (this.descri_val != null)
1936
- if (this.descri_val != "") {
1937
- this.dis_value = this.descri_val;
2800
+ FHPickListComponent.prototype.ngAfterViewInit = function () { };
2801
+ FHPickListComponent.prototype.filtra = function () {
2802
+ this.value_list_sel = new Array();
2803
+ // console.log('filtra() '+this.fltr_user.toUpperCase());
2804
+ if (this.fltr_user == "") {
2805
+ for (var i = 0; i < this.value_list.length; i++) {
2806
+ this.value_list_sel.push(this.value_list[i]);
2807
+ if (i == 50 && this.limit_size)
1938
2808
  return;
2809
+ }
2810
+ }
2811
+ else {
2812
+ for (var i = 0; i < this.value_list.length; i++)
2813
+ if (this.value_list[i].descrizione_valore
2814
+ .toUpperCase()
2815
+ .indexOf(this.fltr_user.toUpperCase()) != -1) {
2816
+ var b_found_a = false;
2817
+ for (var z = 0; z < this.value_list_sel.length; z++)
2818
+ if (this.value_list_sel[z].descrizione_valore ==
2819
+ this.value_list[i].descrizione_valore) {
2820
+ b_found_a = true;
2821
+ break;
2822
+ }
2823
+ if (!b_found_a)
2824
+ this.value_list_sel.push(this.value_list[i]);
2825
+ if (this.value_list_sel.length == 50 && this.limit_size)
2826
+ return;
1939
2827
  }
1940
- if (this.valDef == null)
1941
- this.dis_value = "";
1942
- else
1943
- this.dis_value = this.valDef.split("-1").join("");
1944
- }
1945
- catch (e) {
1946
- console.log("errore split -> this.valDef ", this.valDef);
1947
2828
  }
2829
+ /*
2830
+ this.value_list_sel =new Array();
2831
+ for(let i:number=0;i<this.value_list.length;i++)
2832
+ {
2833
+ let b_found_a=false;
2834
+ for(let z:number=0;z<this.value_list_sel.length;z++)
2835
+ if(this.value_list_sel[z].descrizione_valore==this.value_list[i].descrizione_valore){b_found_a=true; break;}
2836
+
2837
+ if(!b_found_a && (this.value_list[i].descrizione_valore.toUpperCase().indexOf(this.fltr_user.toUpperCase())!=-1 || this.fltr_user==''))
2838
+ {
2839
+ // console.log(this.value_list[i].username);
2840
+ if(this.value_sel==null) this.value_list_sel.push(this.value_list[i]);
2841
+ else
2842
+ {
2843
+
2844
+ let b_found=false;
2845
+ for(let y:number=0;y<this.value_sel.length;y++)
2846
+ if(this.value_sel[y].descrizione_valore==this.value_list[i].descrizione_valore){b_found=true; break;}
2847
+ if(!b_found)
2848
+ this.value_list_sel.push(this.value_list[i]);
2849
+ }
2850
+ }
2851
+ }*/
2852
+ // console.log(this.value_list);
1948
2853
  };
1949
- FHComboboxComponent.prototype.resetValue = function () {
1950
- this.selval = "-1";
1951
- this.valDef = "-1";
1952
- this.update_dis();
1953
- };
1954
- FHComboboxComponent.prototype.focus = function () {
1955
- this.smtr.nativeElement.focus();
1956
- };
1957
- FHComboboxComponent.prototype.reset = function () {
1958
- console.log("reset");
1959
- this.selval = "-1";
1960
- this.valDef = "-1";
1961
- this.myData = new Array();
1962
- this.update_dis();
1963
- };
1964
- FHComboboxComponent.prototype.fillCombo = function () {
2854
+ FHPickListComponent.prototype.fill_list = function (k, arrs) {
1965
2855
  var _this = this;
1966
- // console.log(this.init_fill);
1967
- // if(!this.init_fill){this.init_fill=true;return;}
1968
- if (this.sql == null)
1969
- this.sql = "";
1970
- if (this.sql.indexOf("|") != -1 && this.sql.indexOf("$") != -1) {
1971
- this.set_options(this.sql);
1972
- return;
1973
- }
2856
+ this.value_sel = [];
2857
+ var ok_op = false;
1974
2858
  var p = new QParam();
1975
- p.sql = this.sql;
2859
+ p.sql = k;
1976
2860
  p.types = this.types;
1977
2861
  p.values = this.values;
1978
- var ok_op = false;
1979
- // console.log(p);
1980
- if (this.db_type == "1")
1981
- this._dataService.doQuery(p).subscribe(function (data) {
1982
- var ok_op = false;
1983
- if (data != null)
1984
- if (data.result_msg == "OK") {
1985
- _this.resetD(data.result_data);
1986
- ok_op = true;
1987
- }
1988
- if (!ok_op) {
1989
- }
1990
- }, function (err) {
1991
- _this.errorMsg =
1992
- "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" +
1993
- _this.sql +
1994
- "]";
1995
- });
1996
- if (this.db_type == "2")
1997
- this._dataService_odbc.doQuery(p).subscribe(function (data) {
1998
- var ok_op = false;
1999
- if (data != null)
2000
- if (data.result_msg == "OK") {
2001
- for (var i = 0; i < data.result_data.length; i++) {
2002
- if (data.result_data[i].VALORE != null)
2003
- data.result_data[i].valore = data.result_data[i].VALORE;
2004
- if (data.result_data[i].DESCRIZIONE_VALORE != null)
2005
- data.result_data[i].descrizione_valore =
2006
- data.result_data[i].DESCRIZIONE_VALORE;
2007
- }
2008
- _this.resetD(data.result_data);
2009
- ok_op = true;
2010
- }
2011
- if (!ok_op) {
2862
+ this._dataService.doQuery(p).subscribe(function (data) {
2863
+ var ok_op = false;
2864
+ if (data != null)
2865
+ if (data.result_msg == "OK") {
2866
+ _this.value_list = data.result_data;
2867
+ for (var i = 0; i < arrs.length; i++)
2868
+ for (var y = 0; y < data.result_data.length; y++)
2869
+ if (arrs[i] ==
2870
+ data.result_data[y].descrizione_valore) {
2871
+ _this.value_sel.push(data.result_data[y]);
2872
+ }
2873
+ for (var y = 0; y < _this.value_sel.length; y++)
2874
+ for (var i = _this.value_list.length - 1; i >= 0; i--)
2875
+ if (_this.value_list[i].descrizione_valore ==
2876
+ _this.value_sel[y].descrizione_valore) {
2877
+ _this.value_list.splice(i, 1);
2878
+ break;
2879
+ }
2880
+ _this.filtra();
2881
+ ok_op = true;
2012
2882
  }
2013
- }, function (err) {
2014
- _this.errorMsg =
2015
- "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI [" +
2016
- _this.sql +
2017
- "]";
2018
- });
2019
- };
2020
- FHComboboxComponent.prototype.add_option = function (o) {
2021
- this.myData.push(o);
2883
+ if (!ok_op) {
2884
+ }
2885
+ }, function (err) {
2886
+ _this.errorMsg =
2887
+ "ERRORE DI CONNESSIONE CON IL SERVER.RITENTARE PIU' TARDI";
2888
+ });
2022
2889
  };
2023
- FHComboboxComponent.prototype.resetD = function (o) {
2024
- this.myData = o;
2025
- this.selval = "-1";
2026
- // console.log(this.smtr); console.log(this.smtr.nativeElement);
2027
- this.setByValue(this.valDef);
2028
- if (this.getValue() == "-1" && this.valDef != "-1")
2029
- this.setByDescri(this.valDef);
2030
- this.fillend.emit();
2890
+ FHPickListComponent.prototype.fill_list_arr = function (k, arrs) {
2891
+ this.value_sel = [];
2892
+ console.log(k, arrs);
2893
+ for (var i = 0; i < arrs.length; i++)
2894
+ for (var y = 0; y < k.length; y++)
2895
+ if (arrs[i] ==
2896
+ k[y].valore) {
2897
+ this.value_sel.push(k[y]);
2898
+ }
2899
+ console.log('value_sel ', this.value_sel);
2900
+ this.value_list = k;
2901
+ for (var y = 0; y < this.value_sel.length; y++)
2902
+ for (var i = this.value_list.length - 1; i >= 0; i--)
2903
+ if (this.value_list[i].descrizione_valore ==
2904
+ this.value_sel[y].descrizione_valore) {
2905
+ this.value_list.splice(i, 1);
2906
+ break;
2907
+ }
2908
+ this.filtra();
2031
2909
  };
2032
- FHComboboxComponent.prototype.setByDescri = function (desc_val) {
2033
- // console.log("setByDescri "+desc_val);
2034
- this.valDef = desc_val;
2035
- this.selval = "-1";
2036
- if (desc_val == "")
2037
- return;
2038
- if (this.myData == null)
2039
- return;
2040
- if (this.myData.length == 0 || this.myData[0] == null)
2910
+ FHPickListComponent.prototype.do_add = function () {
2911
+ if (this.selectedAdd == null) {
2912
+ this.toastr.error("ERRORE", "Selezionare il valore da aggiungere", {
2913
+ timeOut: 1000,
2914
+ progressBar: true,
2915
+ });
2041
2916
  return;
2042
- for (var j = 0; j < this.myData.length; j++)
2043
- if (this.myData[j].descrizione_valore == desc_val) {
2044
- this.selval = "" + this.myData[j].valore;
2045
- if (this.myData[j].descrizione_valore != null)
2046
- this.descri_val = this.myData[j].descrizione_valore;
2047
- this.update_dis();
2048
- return;
2917
+ }
2918
+ var index = this.value_list.indexOf(this.selectedAdd, 0);
2919
+ if (!this.single_sel)
2920
+ if (index > -1) {
2921
+ this.value_list.splice(index, 1);
2049
2922
  }
2050
- this.update_dis();
2923
+ if (this.single_sel)
2924
+ this.value_sel = new Array();
2925
+ this.value_sel.push(this.selectedAdd);
2926
+ this.selectedAdd = null;
2927
+ this.filtra();
2928
+ if (this.single_sel)
2929
+ this.ok();
2051
2930
  };
2052
- FHComboboxComponent.prototype.setByIndex = function (ind) {
2053
- this.valDef = "";
2054
- this.selval = "-1";
2055
- if (this.myData == null)
2056
- return;
2057
- if (this.myData.length == 0 || this.myData[0] == null)
2931
+ FHPickListComponent.prototype.do_rem = function () {
2932
+ if (this.selectedRemove == null) {
2933
+ this.toastr.error("ERRORE", "Selezionare il valore da rimuovere", {
2934
+ timeOut: 1000,
2935
+ progressBar: true,
2936
+ });
2058
2937
  return;
2059
- if (this.myData.length > ind) {
2060
- this.setByDescri(this.myData[ind].descrizione_valore);
2061
2938
  }
2939
+ var index = this.value_sel.indexOf(this.selectedRemove, 0);
2940
+ if (index > -1) {
2941
+ this.value_sel.splice(index, 1);
2942
+ }
2943
+ this.value_list.push(this.selectedRemove);
2944
+ this.selectedRemove = null;
2945
+ this.filtra();
2062
2946
  };
2063
- FHComboboxComponent.prototype.getObj = function () {
2064
- if (this.selval == null)
2065
- return null;
2066
- if (this.selval == "-1")
2067
- return null;
2068
- else
2069
- for (var j = 0; j < this.myData.length; j++)
2070
- if (this.myData[j].valore == this.selval) {
2071
- return this.myData[j];
2072
- }
2947
+ FHPickListComponent.prototype.addTo = function (item) {
2948
+ this.option = true;
2949
+ this.selectedAdd = item;
2950
+ this.selectedRemove = null;
2073
2951
  };
2074
- FHComboboxComponent.prototype.setByValue = function (desc_val) {
2075
- this.valDef = desc_val;
2076
- this.selval = "-1";
2077
- // console.log(this.myData);
2078
- if ("" + desc_val == "") {
2079
- // console.log('qqq1111');
2080
- return;
2081
- }
2082
- // console.log("qui");
2083
- if (this.myData == null)
2084
- return;
2085
- // console.log("qui1");
2086
- if (this.myData.length == 0 || this.myData[0] == null)
2087
- return;
2088
- //console.log("qui2");
2089
- for (var j = 0; j < this.myData.length; j++) {
2090
- //console.log(this.myData[j].valore +' '+ desc_val);
2091
- if (this.myData[j].valore == desc_val) {
2092
- this.selval = "" + this.myData[j].valore;
2093
- if (this.myData[j].descrizione_valore != null)
2094
- this.descri_val = this.myData[j].descrizione_valore;
2095
- this.update_dis();
2096
- return;
2097
- }
2952
+ FHPickListComponent.prototype.removeTo = function (item) {
2953
+ this.option = false;
2954
+ this.selectedAdd = null;
2955
+ this.selectedRemove = item;
2956
+ };
2957
+ FHPickListComponent.prototype.getSelStr = function () {
2958
+ var sx = "";
2959
+ for (var i = 0; i < this.value_sel.length; i++) {
2960
+ if (sx != "")
2961
+ sx = sx + ",";
2962
+ sx = sx + this.value_sel[i].descrizione_valore;
2098
2963
  }
2099
- this.update_dis();
2964
+ return sx;
2100
2965
  };
2101
- FHComboboxComponent.prototype.getDescri = function () {
2102
- if (!this.enabled) {
2103
- if (this.selval == null)
2104
- return this.valDef;
2105
- if (this.selval == "-1")
2106
- return this.valDef;
2107
- }
2108
- if (this.selval == null)
2109
- return "-1";
2110
- if (this.selval == "-1")
2111
- return "-1";
2112
- else
2113
- for (var j = 0; j < this.myData.length; j++)
2114
- if (this.myData[j].valore == this.selval) {
2115
- return this.myData[j].descrizione_valore;
2116
- }
2966
+ FHPickListComponent.prototype.getSelArr = function () {
2967
+ return this.value_sel;
2117
2968
  };
2118
- FHComboboxComponent.prototype.getValue = function () {
2119
- // console.log(this.selval);
2120
- if (!this.enabled) {
2121
- if (this.selval == null)
2122
- return this.valDef;
2123
- if (this.selval == "-1")
2124
- return this.valDef;
2125
- }
2126
- if (this.selval == null)
2127
- return "-1";
2128
- if (this.selval == "")
2129
- return "-1";
2130
- else
2131
- return this.selval;
2969
+ FHPickListComponent.prototype.ok = function () {
2970
+ this.dialogRef.close(this.getSelArr());
2132
2971
  };
2133
- FHComboboxComponent.prototype.getData = function (campo) {
2134
- for (var x in this.myData) {
2135
- if (this.myData[x]["valore"] == this.selval) {
2136
- return this.myData[x][campo];
2137
- }
2138
- else {
2139
- continue;
2972
+ FHPickListComponent.ctorParameters = function () { return [
2973
+ { type: dialog.MatDialogRef },
2974
+ { type: QueryService },
2975
+ { type: ngxToastr.ToastrService },
2976
+ { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
2977
+ ]; };
2978
+ __decorate([
2979
+ core.Input(),
2980
+ __metadata("design:type", Array)
2981
+ ], FHPickListComponent.prototype, "value_list", void 0);
2982
+ __decorate([
2983
+ core.Input(),
2984
+ __metadata("design:type", Boolean)
2985
+ ], FHPickListComponent.prototype, "single_sel", void 0);
2986
+ __decorate([
2987
+ core.Input(),
2988
+ __metadata("design:type", Boolean)
2989
+ ], FHPickListComponent.prototype, "vis_buttons", void 0);
2990
+ __decorate([
2991
+ core.Input(),
2992
+ __metadata("design:type", Boolean)
2993
+ ], FHPickListComponent.prototype, "limit_size", void 0);
2994
+ __decorate([
2995
+ core.Input(),
2996
+ __metadata("design:type", Array)
2997
+ ], FHPickListComponent.prototype, "value_sel", void 0);
2998
+ FHPickListComponent = __decorate([
2999
+ core.Component({
3000
+ selector: "FHPickList",
3001
+ template: "\n <div fxLayout=\"column\" fxLayoutGap=\"15px\" fxFlex>\n <div fxLayout=\"row\">\n <div fxLayout=\"column\" fxFlex=\"41%\">\n <div style=\"width:100%;height:420px;overflow:auto;\">\n <table style=\"width: 100%\" class=\"fh_table\">\n <thead>\n <tr>\n <th>VALORI SELEZIONABILI</th>\n </tr>\n </thead>\n\n <tbody>\n <tr>\n <td>\n <input\n [(ngModel)]=\"fltr_user\"\n (ngModelChange)=\"filtra()\"\n style=\"padding:8px;margin:15px auto;width:100%;\"\n placeholder=\"Ricerca...\"\n />\n </td>\n </tr>\n <tr\n *ngFor=\"\n let u of value_list_sel;\n let odd = odd;\n let even = even\n \"\n\n (click)=\"addTo(u)\"\n (dblclick)=\"do_add()\"\n class=\"selector\"\n\n [ngClass]=\"{ active: selectedAdd == u }\"\n >\n <td [ngClass]=\"{ odd: odd, even: even }\" style=\"cursor:pointer\">{{ u.descrizione_valore }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div\n fxLayout=\"column\"\n fxFlex=\"18%\"\n style=\"height: 280px; position: relative; margin:0 .5em; padding-left: .5em; padding-right: .5em; border-left: 1px solid rgba(191, 191, 191, 0.5); border-right: 1px solid rgba(191, 191, 191, 0.5);\"\n >\n <div\n style=\"position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);\"\n >\n <button\n mat-flat-button\n color=\"primary\"\n (click)=\"do_add()\"\n [disabled]=\"!option\"\n >\n <mat-icon>arrow_forward</mat-icon>\n </button>\n <br /><br />\n <button\n mat-flat-button\n color=\"primary\"\n (click)=\"do_rem()\"\n [disabled]=\"option\"\n >\n <mat-icon>delete</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout=\"column\" fxFlex=\"41%\">\n <div style=\"width:100%;height:420px;overflow:auto;\">\n <table style=\"width: 100%\" class=\"fh_table\">\n <thead>\n <tr>\n <th>VALORI SELEZIONATI</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let u of value_sel; let odd = odd; let even = even\"\n (mouseover)=\"selectedRemove = u\"\n [ngClass]=\"{ odd: odd, even: even }\"\n (click)=\"removeTo(u)\"\n (dblclick)=\"do_rem()\"\n class=\"selector\"\n [ngClass]=\"{ active: selectedRemove == u }\"\n >\n <td [ngClass]=\"{ odd: odd, even: even }\" style=\"cursor:pointer\">{{ u.descrizione_valore }}</td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <br /><br />\n <div fxLayout=\"row\" fxLayoutAlign=\"center center\" fxLayoutGap=\"5px\">\n <button mat-flat-button color=\"primary\" (click)=\"ok()\">Ok</button\n >&nbsp;&nbsp;&nbsp;\n <button\n mat-flat-button\n style=\"background-color: #F5F5F5\"\n (click)=\"dialogRef.close()\"\n >\n Annulla\n </button>\n </div>\n </div>\n ",
3002
+ styles: ["\n .selector {\n cursor: hand;\n }\n "]
3003
+ }),
3004
+ __param(3, core.Inject(dialog.MAT_DIALOG_DATA)),
3005
+ __metadata("design:paramtypes", [dialog.MatDialogRef,
3006
+ QueryService,
3007
+ ngxToastr.ToastrService, Object])
3008
+ ], FHPickListComponent);
3009
+ return FHPickListComponent;
3010
+ }());
3011
+
3012
+ var CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1 = {
3013
+ provide: forms.NG_VALUE_ACCESSOR,
3014
+ useExisting: core.forwardRef(function () { return FHPickFieldComponent; }),
3015
+ multi: true,
3016
+ };
3017
+ var FHPickFieldComponent = /** @class */ (function () {
3018
+ function FHPickFieldComponent(dataservice, dialog) {
3019
+ this.dataservice = dataservice;
3020
+ this.dialog = dialog;
3021
+ this.label = '';
3022
+ this.required = false;
3023
+ this.enabled = true;
3024
+ this.hidden = false;
3025
+ this.sep = ',';
3026
+ this.value_list = new Array();
3027
+ this.single_sel = false;
3028
+ this.vis_buttons = true;
3029
+ this.limit_size = false;
3030
+ this.value_sel = [];
3031
+ this.change = new core.EventEmitter();
3032
+ this.t_value = "";
3033
+ this.i_value = "";
3034
+ this.selectedUser = [];
3035
+ this.onChange = function (_) { };
3036
+ this.onTouched = function () { };
3037
+ }
3038
+ FHPickFieldComponent.prototype.ngAfterViewInit = function () {
3039
+ var _this = this;
3040
+ setTimeout(function () {
3041
+ if (_this.required)
3042
+ _this.label = _this.label + " *";
3043
+ });
3044
+ };
3045
+ FHPickFieldComponent.prototype.set_by_value = function (v) {
3046
+ if (v == null)
3047
+ this.clear();
3048
+ if (v == '')
3049
+ this.clear();
3050
+ var vx = v.split(this.sep);
3051
+ this.t_value = '';
3052
+ this.i_value = '';
3053
+ this.value_sel = [];
3054
+ for (var ix = 0; ix < vx.length; ix++) {
3055
+ for (var index = 0; index < this.value_list.length; index++) {
3056
+ if (vx[ix] == this.value_list[index].valore) {
3057
+ if (this.t_value != '')
3058
+ this.t_value += this.sep;
3059
+ this.t_value += this.value_list[index].descrizione_valore;
3060
+ if (this.i_value != '')
3061
+ this.i_value += this.sep;
3062
+ this.i_value += this.value_list[index].valore;
3063
+ this.value_sel.push(this.value_list[index].valore);
3064
+ break;
3065
+ }
2140
3066
  }
2141
3067
  }
2142
3068
  };
2143
- FHComboboxComponent.prototype.set_options = function (s) {
2144
- this.myData = new Array();
2145
- var a = s.split("$");
2146
- for (var i = 0; i < a.length; i++) {
2147
- var o = new Object();
2148
- var av = a[i].split("|");
2149
- o.valore = av[1];
2150
- o.descrizione_valore = av[0];
2151
- this.myData.push(o);
3069
+ FHPickFieldComponent.prototype.writeValue = function (value) {
3070
+ if (value == null) {
3071
+ this.clear();
3072
+ return;
2152
3073
  }
2153
- this.setByValue(this.valDef);
2154
- if (this.getValue() == "-1")
2155
- this.setByDescri(this.valDef);
3074
+ if (value == '') {
3075
+ this.clear();
3076
+ return;
3077
+ }
3078
+ this.set_by_value(value);
2156
3079
  };
2157
- FHComboboxComponent.prototype.ngAfterViewInit = function () {
3080
+ FHPickFieldComponent.prototype.open_pick = function () {
2158
3081
  var _this = this;
2159
- setTimeout(function () {
2160
- if (_this.init_fill == true) {
2161
- if (_this.sql == "") {
2162
- //this.errorMsg="QUERY NON CONFIGURATA";
2163
- return;
2164
- }
2165
- _this.fillCombo();
2166
- }
2167
- else {
2168
- _this.errorMsg = "";
3082
+ if (!this.enabled)
3083
+ return;
3084
+ var dialogRef = this.dialog.open(FHPickListComponent, {
3085
+ disableClose: true,
3086
+ width: "700px",
3087
+ height: "550px", data: {
3088
+ value_list: JSON.parse(JSON.stringify(this.value_list)),
3089
+ single_sel: this.single_sel,
3090
+ vis_buttons: this.vis_buttons,
3091
+ limit_size: this.limit_size,
3092
+ value_sel: JSON.parse(JSON.stringify(this.value_sel))
2169
3093
  }
2170
- _this.initend.emit();
2171
3094
  });
2172
- };
2173
- FHComboboxComponent.prototype.sc = function () {
2174
- this.onChange(this.getValue());
2175
- this.selchange.emit({
2176
- event: this.getObj(),
2177
- valore: this.getValue(),
2178
- descrizione_valore: this.getDescri(),
3095
+ dialogRef.afterClosed().subscribe(function (result) {
3096
+ if (result != null) {
3097
+ _this.set_by_value(result.map(function (v) { return v.valore; }).join(_this.sep));
3098
+ _this.change.emit(result);
3099
+ _this.onChange(_this.i_value);
3100
+ }
2179
3101
  });
2180
3102
  };
2181
- FHComboboxComponent.prototype.getModelValue = function () {
2182
- var value = this.getData("valore");
2183
- return value;
2184
- };
2185
- FHComboboxComponent.prototype.writeValue = function (value) {
2186
- this.setByValue(value);
3103
+ FHPickFieldComponent.prototype.clear = function () {
3104
+ this.t_value = '';
3105
+ this.i_value = '';
3106
+ this.onChange('');
2187
3107
  };
2188
- FHComboboxComponent.prototype.registerOnChange = function (fn) {
3108
+ FHPickFieldComponent.prototype.registerOnChange = function (fn) {
2189
3109
  this.onChange = fn;
2190
3110
  };
2191
- FHComboboxComponent.prototype.registerOnTouched = function (fn) {
3111
+ FHPickFieldComponent.prototype.registerOnTouched = function (fn) {
2192
3112
  this.onTouched = fn;
2193
3113
  };
2194
- FHComboboxComponent.ctorParameters = function () { return [
3114
+ FHPickFieldComponent.ctorParameters = function () { return [
2195
3115
  { type: QueryService },
2196
- { type: OdbcService }
3116
+ { type: dialog.MatDialog }
2197
3117
  ]; };
2198
- __decorate([
2199
- core.Input(),
2200
- __metadata("design:type", Boolean)
2201
- ], FHComboboxComponent.prototype, "init_fill", void 0);
2202
3118
  __decorate([
2203
3119
  core.Input(),
2204
3120
  __metadata("design:type", String)
2205
- ], FHComboboxComponent.prototype, "sql", void 0);
3121
+ ], FHPickFieldComponent.prototype, "label", void 0);
2206
3122
  __decorate([
2207
3123
  core.Input(),
2208
- __metadata("design:type", Array)
2209
- ], FHComboboxComponent.prototype, "types", void 0);
3124
+ __metadata("design:type", Boolean)
3125
+ ], FHPickFieldComponent.prototype, "required", void 0);
2210
3126
  __decorate([
2211
3127
  core.Input(),
2212
- __metadata("design:type", Array)
2213
- ], FHComboboxComponent.prototype, "values", void 0);
3128
+ __metadata("design:type", Boolean)
3129
+ ], FHPickFieldComponent.prototype, "enabled", void 0);
2214
3130
  __decorate([
2215
3131
  core.Input(),
2216
3132
  __metadata("design:type", Boolean)
2217
- ], FHComboboxComponent.prototype, "hidden", void 0);
3133
+ ], FHPickFieldComponent.prototype, "hidden", void 0);
2218
3134
  __decorate([
2219
3135
  core.Input(),
2220
3136
  __metadata("design:type", String)
2221
- ], FHComboboxComponent.prototype, "label", void 0);
3137
+ ], FHPickFieldComponent.prototype, "sep", void 0);
2222
3138
  __decorate([
2223
3139
  core.Input(),
2224
- __metadata("design:type", Boolean)
2225
- ], FHComboboxComponent.prototype, "enabled", void 0);
3140
+ __metadata("design:type", Array)
3141
+ ], FHPickFieldComponent.prototype, "value_list", void 0);
2226
3142
  __decorate([
2227
3143
  core.Input(),
2228
3144
  __metadata("design:type", Boolean)
2229
- ], FHComboboxComponent.prototype, "required", void 0);
3145
+ ], FHPickFieldComponent.prototype, "single_sel", void 0);
2230
3146
  __decorate([
2231
3147
  core.Input(),
2232
- __metadata("design:type", String)
2233
- ], FHComboboxComponent.prototype, "sel_label", void 0);
2234
- __decorate([
2235
- core.ViewChild("cmb"),
2236
- __metadata("design:type", core.ElementRef)
2237
- ], FHComboboxComponent.prototype, "smtr", void 0);
2238
- __decorate([
2239
- core.Output(),
2240
- __metadata("design:type", core.EventEmitter)
2241
- ], FHComboboxComponent.prototype, "fillend", void 0);
2242
- __decorate([
2243
- core.Output(),
2244
- __metadata("design:type", core.EventEmitter)
2245
- ], FHComboboxComponent.prototype, "selchange", void 0);
2246
- __decorate([
2247
- core.Output(),
2248
- __metadata("design:type", core.EventEmitter)
2249
- ], FHComboboxComponent.prototype, "initend", void 0);
3148
+ __metadata("design:type", Boolean)
3149
+ ], FHPickFieldComponent.prototype, "vis_buttons", void 0);
2250
3150
  __decorate([
2251
3151
  core.Input(),
2252
- __metadata("design:type", String)
2253
- ], FHComboboxComponent.prototype, "valDef", void 0);
3152
+ __metadata("design:type", Boolean)
3153
+ ], FHPickFieldComponent.prototype, "limit_size", void 0);
2254
3154
  __decorate([
2255
3155
  core.Input(),
2256
- __metadata("design:type", String)
2257
- ], FHComboboxComponent.prototype, "db_type", void 0);
2258
- FHComboboxComponent = __decorate([
3156
+ __metadata("design:type", Array)
3157
+ ], FHPickFieldComponent.prototype, "value_sel", void 0);
3158
+ __decorate([
3159
+ core.Output(),
3160
+ __metadata("design:type", core.EventEmitter)
3161
+ ], FHPickFieldComponent.prototype, "change", void 0);
3162
+ FHPickFieldComponent = __decorate([
2259
3163
  core.Component({
2260
- selector: "FHComboBox",
3164
+ selector: "FHPickField",
2261
3165
  providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1],
2262
- template: "\n <mat-form-field\n [hidden]=\"!enabled || hidden\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n <mat-select\n #cmb\n [(ngModel)]=\"selval\"\n (selectionChange)=\"sc()\"\n [required]=\"required\"\n >\n <mat-option value=\"-1\">{{ sel_label }}</mat-option>\n <mat-option value=\"{{ app.valore }}\" *ngFor=\"let app of myData\">{{\n app.descrizione_valore\n }}</mat-option>\n </mat-select>\n </mat-form-field>\n\n <mat-form-field\n [hidden]=\"enabled || hidden\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n <input\n type=\"text\"\n #el1\n matInput\n [disabled]=\"true\"\n [(ngModel)]=\"dis_value\"\n />\n </mat-form-field>\n ",
2263
- styles: [""]
3166
+ template: "\n <div fxLayout=\"row\" [hidden]=\"!enabled || hidden\">\n <mat-form-field\n style=\"clickable-field\"\n (click)=\"open_pick()\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n\n <input\n matInput\n [hidden]=\"hidden\"\n type=\"text\"\n [ngModel]=\"t_value\"\n [disabled]=\"false\"\n readonly\n />\n </mat-form-field>\n <button\n mat-icon-button\n matSuffix\n [hidden]=\"selectedUser.length == 0\"\n (click)=\"clear()\"\n >\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n <mat-form-field\n [hidden]=\"enabled || hidden\"\n appearance=\"outline\"\n floatLabel=\"always\"\n ><mat-label>{{ label }}</mat-label>\n <input\n type=\"text\"\n #el1\n matInput\n [disabled]=\"true\"\n [(ngModel)]=\"t_value\"\n />\n </mat-form-field>\n ",
3167
+ styles: ["\n .clickable-field {\n border: 1px solid #000000;\n color: #000000;\n }\n\n .clickable-field:focus {\n outline: none;\n }\n\n :host ::ng-deep .mat-input-element {\n cursor: pointer !important;\n }\n "]
2264
3168
  }),
2265
- __metadata("design:paramtypes", [QueryService,
2266
- OdbcService])
2267
- ], FHComboboxComponent);
2268
- return FHComboboxComponent;
3169
+ __metadata("design:paramtypes", [QueryService, dialog.MatDialog])
3170
+ ], FHPickFieldComponent);
3171
+ return FHPickFieldComponent;
3172
+ }());
3173
+
3174
+ var win_show_log_dett = /** @class */ (function () {
3175
+ function win_show_log_dett(dialogRef, data) {
3176
+ this.dialogRef = dialogRef;
3177
+ this.data = data;
3178
+ this.modifiche = [];
3179
+ this.title = "";
3180
+ this.title = data.title.toUpperCase();
3181
+ this.modifiche = JSON.parse(data.dt);
3182
+ }
3183
+ win_show_log_dett.prototype.close = function () {
3184
+ this.dialogRef.close(null);
3185
+ };
3186
+ win_show_log_dett.prototype.ngAfterViewInit = function () { };
3187
+ win_show_log_dett.ctorParameters = function () { return [
3188
+ { type: dialog.MatDialogRef },
3189
+ { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
3190
+ ]; };
3191
+ win_show_log_dett = __decorate([
3192
+ core.Component({
3193
+ template: "\n <div style=\"width:100%\" fxLayout=\"row\" fxLayoutAlign=\"end start\">\n <img\n src=\"assets/icons/x.png\"\n style=\"cursor: pointer;\"\n (click)=\"close()\"\n />\n </div>\n <hr width=\"100%\" size=\"0.5\" color=\"#DDDDDD\" />\n <h2 mat-dialog-title>DETTAGLIO MODIFICA - {{ title }}</h2>\n\n <mat-dialog-content style=\"min-width:700px\">\n <table style=\"width: 90%\" class=\"fh_table\">\n <thead>\n <tr>\n <th style=\"width:20%;\">Operazione</th>\n <th style=\"width:20%;\">Campo</th>\n <th style=\"width:30%;\">Old Value</th>\n <th style=\"width:30%;\">New Value</th>\n </tr>\n </thead>\n <tbody>\n <tr\n *ngFor=\"let u of modifiche; let odd = odd; let even = even\"\n [ngClass]=\"{ odd: odd, even: even }\"\n >\n <td>{{ u.op }}</td>\n <td>{{ u.path }}</td>\n <td>{{ u.oldVal }}</td>\n <td>{{ u.val }}</td>\n </tr>\n </tbody>\n </table>\n </mat-dialog-content>\n "
3194
+ }),
3195
+ __param(1, core.Inject(dialog.MAT_DIALOG_DATA)),
3196
+ __metadata("design:paramtypes", [dialog.MatDialogRef, Object])
3197
+ ], win_show_log_dett);
3198
+ return win_show_log_dett;
2269
3199
  }());
2270
3200
 
2271
3201
  var FHUploadComponent = /** @class */ (function () {
@@ -2614,75 +3544,6 @@
2614
3544
  return FHUploadComponent;
2615
3545
  }());
2616
3546
 
2617
- var FileService = /** @class */ (function () {
2618
- function FileService(http, app_s, toastr) {
2619
- this.http = http;
2620
- this.app_s = app_s;
2621
- this.toastr = toastr;
2622
- this.url = this.app_s.API_ENDPOINT + this.app_s.FILE_ENDPOINT; // URL to web API this.app_s.API_ENDPOINT
2623
- }
2624
- FileService.prototype.doQuery = function (queryp, displayError) {
2625
- var _this = this;
2626
- if (displayError === void 0) { displayError = true; }
2627
- this.headers = new http.HttpHeaders({
2628
- "Content-Type": "application/json",
2629
- Authorization: "Bearer " + localStorage.getItem(this.app_s.COMPANY_KEY + "token"),
2630
- });
2631
- this.url = this.app_s.API_ENDPOINT + this.app_s.FILE_ENDPOINT;
2632
- // console.log('FileService url: '+ this.url);
2633
- var post_v = JSON.stringify(queryp);
2634
- // console.log(post_v);
2635
- return this.http
2636
- .post(this.url, post_v, {
2637
- headers: this.headers,
2638
- })
2639
- .pipe(operators.map(function (res) {
2640
- // Handle errors, display if enabled
2641
- var r = res;
2642
- var err;
2643
- if (!res) {
2644
- err = new Error("Empty server response");
2645
- }
2646
- else if (r.result_msg === "KO") {
2647
- err = new Error(r.msg);
2648
- }
2649
- if (err) {
2650
- console.error(err);
2651
- if (displayError) {
2652
- _this.toastr.error(err.message);
2653
- }
2654
- throw new Error(err);
2655
- }
2656
- return res || new QGResult();
2657
- }), operators.catchError(function (err) {
2658
- // In a real world app, we might use a remote logging infrastructure
2659
- // We'd also dig deeper into the error to get a better message
2660
- var errMsg = err.message
2661
- ? err.message
2662
- : err.status
2663
- ? err.status + " - " + err.statusText
2664
- : "Server error";
2665
- console.error(errMsg); // log to console instead
2666
- throw err;
2667
- }));
2668
- };
2669
- FileService.ctorParameters = function () { return [
2670
- { type: http.HttpClient },
2671
- { type: AppService },
2672
- { type: ngxToastr.ToastrService }
2673
- ]; };
2674
- FileService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function FileService_Factory() { return new FileService(core["ɵɵinject"](http.HttpClient), core["ɵɵinject"](AppService), core["ɵɵinject"](ngxToastr.ToastrService)); }, token: FileService, providedIn: "root" });
2675
- FileService = __decorate([
2676
- core.Injectable({
2677
- providedIn: "root",
2678
- }),
2679
- __metadata("design:paramtypes", [http.HttpClient,
2680
- AppService,
2681
- ngxToastr.ToastrService])
2682
- ], FileService);
2683
- return FileService;
2684
- }());
2685
-
2686
3547
  var AuthenticationService = /** @class */ (function () {
2687
3548
  function AuthenticationService(_dataService, toastr, http$1, router, route, _fileService, app_s, uti_s) {
2688
3549
  this._dataService = _dataService;
@@ -2968,134 +3829,6 @@
2968
3829
  return AuthenticationService;
2969
3830
  }());
2970
3831
 
2971
- var WinAskTextBigComponent = /** @class */ (function () {
2972
- function WinAskTextBigComponent(dialogRef, toastr, data) {
2973
- this.dialogRef = dialogRef;
2974
- this.toastr = toastr;
2975
- this.data = data;
2976
- this.title = "";
2977
- this.label = "";
2978
- this.valore = "";
2979
- this.readonly = false;
2980
- this.show_annulla = true;
2981
- this.show_ok = true;
2982
- this.min_chars = 3;
2983
- if (data != null) {
2984
- if (data.title != null)
2985
- this.title = data.title;
2986
- if (data.label != null)
2987
- this.label = data.label;
2988
- if (data.valore != null)
2989
- this.valore = data.valore;
2990
- if (data.readonly != null)
2991
- this.readonly = data.readonly;
2992
- if (data.show_annulla != null)
2993
- this.show_annulla = data.show_annulla;
2994
- if (data.show_ok != null)
2995
- this.show_ok = data.show_ok;
2996
- if (data.min_chars != null)
2997
- this.min_chars = data.min_chars;
2998
- }
2999
- }
3000
- WinAskTextBigComponent.prototype.ngAfterViewInit = function () { };
3001
- WinAskTextBigComponent.prototype.close = function () {
3002
- this.dialogRef.close(null);
3003
- };
3004
- WinAskTextBigComponent.prototype.show = function () { };
3005
- WinAskTextBigComponent.prototype.hide = function () {
3006
- this.dialogRef.close(null);
3007
- };
3008
- WinAskTextBigComponent.prototype.do_check = function () {
3009
- if (this.valore.length < this.min_chars) {
3010
- this.toastr.error("Il valore deve contenere almeno " + this.min_chars + " caratteri");
3011
- return;
3012
- }
3013
- this.dialogRef.close(this.valore);
3014
- };
3015
- WinAskTextBigComponent.prototype.chiudi = function () {
3016
- this.dialogRef.close(null);
3017
- };
3018
- WinAskTextBigComponent.ctorParameters = function () { return [
3019
- { type: dialog.MatDialogRef },
3020
- { type: ngxToastr.ToastrService },
3021
- { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
3022
- ]; };
3023
- WinAskTextBigComponent = __decorate([
3024
- core.Component({
3025
- selector: "app-win_ask_text",
3026
- template: "\n <div style=\"width:100%\" fxLayout=\"row\" fxLayoutAlign=\"end start\">\n <img\n src=\"assets/icons/x.png\"\n style=\"cursor: pointer;\"\n (click)=\"close()\"\n />\n </div>\n <hr width=\"100%\" size=\"0.5\" color=\"#DDDDDD\" />\n\n <h2 mat-dialog-title>{{ title }}</h2>\n <mat-dialog-content style=\"width:630px;font-size: 15px;\">\n <mat-form-field\n appearance=\"outline\"\n floatLabel=\"always\"\n style=\"width:100%\"\n ><mat-label>{{ label }}</mat-label>\n <textarea\n matInput\n [readonly]=\"readonly\"\n [(ngModel)]=\"valore\"\n rows=\"15\"\n required\n ></textarea>\n </mat-form-field>\n </mat-dialog-content>\n <mat-dialog-actions>\n <div\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n style=\"width: 100%\"\n [hidden]=\"readonly\"\n >\n <button\n *ngIf=\"show_ok\"\n mat-flat-button\n color=\"primary\"\n (click)=\"do_check()\"\n >\n OK</button\n >&nbsp;&nbsp;&nbsp;\n <button\n *ngIf=\"show_annulla\"\n mat-flat-button\n color=\"warn\"\n (click)=\"chiudi()\"\n >\n ANNULLA\n </button>\n </div>\n <div\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n style=\"width: 100%\"\n [hidden]=\"!readonly\"\n >\n <button\n *ngIf=\"show_annulla\"\n mat-flat-button\n color=\"warn\"\n (click)=\"chiudi()\"\n >\n CHIUDI\n </button>\n </div>\n </mat-dialog-actions>\n "
3027
- }),
3028
- __param(2, core.Inject(dialog.MAT_DIALOG_DATA)),
3029
- __metadata("design:paramtypes", [dialog.MatDialogRef,
3030
- ngxToastr.ToastrService, Object])
3031
- ], WinAskTextBigComponent);
3032
- return WinAskTextBigComponent;
3033
- }());
3034
-
3035
- var FHWinComboSelect = /** @class */ (function () {
3036
- function FHWinComboSelect(dialogRef, toastr, data) {
3037
- this.dialogRef = dialogRef;
3038
- this.toastr = toastr;
3039
- this.data = data;
3040
- this.label = "";
3041
- this.width = "100%";
3042
- this.nota = false;
3043
- this.nota_val = "";
3044
- if (data == null)
3045
- return;
3046
- if (data != null) {
3047
- var lab = "";
3048
- var arrd = [];
3049
- var nota = false;
3050
- if (data.label != null)
3051
- lab = data.label;
3052
- if (data.arr_option != null)
3053
- arrd = data.arr_option;
3054
- if (data.nota != null)
3055
- nota = data.nota;
3056
- this.set_selection(lab, arrd, nota);
3057
- }
3058
- }
3059
- FHWinComboSelect.prototype.close = function () {
3060
- this.dialogRef.close(null);
3061
- };
3062
- FHWinComboSelect.prototype.set_selection = function (lab, myD, nota) {
3063
- if (nota === void 0) { nota = false; }
3064
- this.nota = nota;
3065
- this.label = lab;
3066
- for (var i = 0; i < myD.length; i++)
3067
- this.cmb_sel.add_option(myD[i]);
3068
- };
3069
- FHWinComboSelect.prototype.ok = function () {
3070
- if (this.cmb_sel.getValue() == "-1") {
3071
- this.toastr.error("Selezionare un valore");
3072
- return;
3073
- }
3074
- this.cmb_sel.getObj().nota = this.nota_val;
3075
- this.dialogRef.close(this.cmb_sel.getObj());
3076
- };
3077
- FHWinComboSelect.prototype.ngAfterViewInit = function () { };
3078
- FHWinComboSelect.ctorParameters = function () { return [
3079
- { type: dialog.MatDialogRef },
3080
- { type: ngxToastr.ToastrService },
3081
- { type: undefined, decorators: [{ type: core.Inject, args: [dialog.MAT_DIALOG_DATA,] }] }
3082
- ]; };
3083
- __decorate([
3084
- core.ViewChild("cmb_sel"),
3085
- __metadata("design:type", FHComboboxComponent)
3086
- ], FHWinComboSelect.prototype, "cmb_sel", void 0);
3087
- FHWinComboSelect = __decorate([
3088
- core.Component({
3089
- selector: "fhwincomboselect",
3090
- template: "\n <div style=\"width:100%\" fxLayout=\"row\" fxLayoutAlign=\"end start\">\n <img\n src=\"assets/icons/x.png\"\n style=\"cursor: pointer;\"\n (click)=\"close()\"\n />\n </div>\n <hr width=\"100%\" size=\"0.5\" color=\"#DDDDDD\" />\n\n <div fxLayout=\"column\">\n <mat-dialog-content style=\"font-size: 15px;\">\n <div fxLayout=\"column\">\n <h3>\n {{ label | uppercase }}\n </h3>\n <FHComboBox #cmb_sel [init_fill]=\"false\"></FHComboBox>\n <mat-form-field *ngIf=\"nota\" appearance=\"outline\" floatLabel=\"always\"\n ><mat-label>Nota</mat-label>\n <textarea matInput [(ngModel)]=\"nota_val\" rows=\"12\"></textarea>\n </mat-form-field>\n </div>\n </mat-dialog-content>\n\n <mat-dialog-actions\n fxFlex=\"100\"\n fxLayout=\"row\"\n fxLayoutAlign=\"center center\"\n >\n <button mat-flat-button color=\"primary\" (click)=\"ok()\">OK</button\n >&nbsp;&nbsp;&nbsp;&nbsp;\n <button mat-flat-button color=\"warn\" (click)=\"close()\">ANNULLA</button>\n </mat-dialog-actions>\n </div>\n "
3091
- }),
3092
- __param(2, core.Inject(dialog.MAT_DIALOG_DATA)),
3093
- __metadata("design:paramtypes", [dialog.MatDialogRef,
3094
- ngxToastr.ToastrService, Object])
3095
- ], FHWinComboSelect);
3096
- return FHWinComboSelect;
3097
- }());
3098
-
3099
3832
  var FHUploadPanelComponent = /** @class */ (function () {
3100
3833
  function FHUploadPanelComponent(_appservice, _dataService, toastr, dialog, auth_s, uti) {
3101
3834
  this._appservice = _appservice;
@@ -5107,15 +5840,6 @@
5107
5840
  return wkfapp;
5108
5841
  }());
5109
5842
 
5110
- var FSInput = /** @class */ (function () {
5111
- function FSInput() {
5112
- this.command = "";
5113
- this.p1 = "";
5114
- this.p2 = "";
5115
- }
5116
- return FSInput;
5117
- }());
5118
-
5119
5843
  var OfficeOperation = /** @class */ (function () {
5120
5844
  function OfficeOperation() {
5121
5845
  }
@@ -16446,7 +17170,7 @@
16446
17170
  win_salva_annulla,
16447
17171
  FormBuilderComponent,
16448
17172
  FormExecuterComponent,
16449
- FHTableManager, FHPickFieldComponent
17173
+ FHTableManager, FHPickFieldComponent, FHUploadPanelS3Component, FHUploadS3Component
16450
17174
  ],
16451
17175
  declarations: [
16452
17176
  win_show_log_dett,
@@ -16524,7 +17248,7 @@
16524
17248
  FHTableManager,
16525
17249
  win_manage_values,
16526
17250
  win_manage_roles,
16527
- FHComboboxComponentFilter, FHPickFieldComponent
17251
+ FHComboboxComponentFilter, FHPickFieldComponent, FHUploadPanelS3Component, FHUploadS3Component
16528
17252
  ],
16529
17253
  providers: [HighlightService, ng2Dragula.DragulaService],
16530
17254
  entryComponents: [
@@ -16793,6 +17517,8 @@
16793
17517
  exports.FHTimePickerComponent = FHTimePickerComponent;
16794
17518
  exports.FHUploadComponent = FHUploadComponent;
16795
17519
  exports.FHUploadPanelComponent = FHUploadPanelComponent;
17520
+ exports.FHUploadPanelS3Component = FHUploadPanelS3Component;
17521
+ exports.FHUploadS3Component = FHUploadS3Component;
16796
17522
  exports.FHUserFieldComponent = FHUserFieldComponent;
16797
17523
  exports.FHUserPickerComponent = FHUserPickerComponent;
16798
17524
  exports.FHWinComboSelect = FHWinComboSelect;
@@ -16834,7 +17560,7 @@
16834
17560
  exports.win_user_info = win_user_info;
16835
17561
  exports.wkf_header_bar = wkf_header_bar;
16836
17562
  exports.wkfapp = wkfapp;
16837
- exports.ɵa = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR;
17563
+ exports.ɵa = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1;
16838
17564
  exports.ɵb = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$3;
16839
17565
  exports.ɵba = win_select_canale;
16840
17566
  exports.ɵbb = win_select_level;
@@ -16851,7 +17577,7 @@
16851
17577
  exports.ɵbm = FHComboboxComponentFilter;
16852
17578
  exports.ɵc = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$9;
16853
17579
  exports.ɵd = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$5;
16854
- exports.ɵe = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$1;
17580
+ exports.ɵe = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR;
16855
17581
  exports.ɵf = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$8;
16856
17582
  exports.ɵg = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR$6;
16857
17583
  exports.ɵh = CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR_NUMERIC;