@fluxhub/fluxhub-lib 1.0.374 → 1.0.376

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.
@@ -3069,6 +3069,7 @@ var FHUploadComponent = /** @class */ (function () {
3069
3069
  this.lista_allegati = [];
3070
3070
  this.change = new EventEmitter();
3071
3071
  this.upload_ended = new EventEmitter();
3072
+ this.allow_delete = false;
3072
3073
  this.loading = false;
3073
3074
  this.App = '';
3074
3075
  this.K = '';
@@ -3084,6 +3085,7 @@ var FHUploadComponent = /** @class */ (function () {
3084
3085
  url: this.app_s.API_ENDPOINT + this.app_s.UPLOAD_ENDPOINT,
3085
3086
  'maxFileSize': 500 * 1024 * 1024
3086
3087
  });
3088
+ this.id = null;
3087
3089
  this.username = this.app_s.user;
3088
3090
  this.uploader.onBeforeUploadItem = (/**
3089
3091
  * @param {?} item
@@ -3111,6 +3113,61 @@ var FHUploadComponent = /** @class */ (function () {
3111
3113
  }
3112
3114
  });
3113
3115
  }
3116
+ /**
3117
+ * @return {?}
3118
+ */
3119
+ FHUploadComponent.prototype.del_doc = /**
3120
+ * @return {?}
3121
+ */
3122
+ function () {
3123
+ var _this = this;
3124
+ localStorage.setItem(this.app_s.COMPANY_KEY + "title_dialog", 'Conferma Operazione');
3125
+ localStorage.setItem(this.app_s.COMPANY_KEY + "msg_dialog", "Confermi l'eliminazione dell'elemento?");
3126
+ /** @type {?} */
3127
+ var dialogRef = this
3128
+ .dialog
3129
+ .open(FHConfirmComponent);
3130
+ dialogRef
3131
+ .afterClosed()
3132
+ .subscribe((/**
3133
+ * @param {?} result
3134
+ * @return {?}
3135
+ */
3136
+ function (result) {
3137
+ if (result) {
3138
+ /** @type {?} */
3139
+ var p = new QParam();
3140
+ p.sql = "DELETE_ALLEGATO";
3141
+ p.types = ['int', 'string'];
3142
+ p.values = [_this.id, _this.app_s.user];
3143
+ _this
3144
+ ._dataService
3145
+ .doQuery(p)
3146
+ .subscribe((/**
3147
+ * @param {?} data
3148
+ * @return {?}
3149
+ */
3150
+ function (data) {
3151
+ if (data != null)
3152
+ if (data.result_msg == "OK") {
3153
+ // this.arr_g = data.result_data;
3154
+ _this.ref_allegato();
3155
+ _this
3156
+ .toastr
3157
+ .info("INFO", "ALLEGATO ELIMINATO", {
3158
+ timeOut: 1000,
3159
+ progressBar: true
3160
+ });
3161
+ }
3162
+ }), (/**
3163
+ * @param {?} err
3164
+ * @return {?}
3165
+ */
3166
+ function (err) {
3167
+ }));
3168
+ }
3169
+ }));
3170
+ };
3114
3171
  /**
3115
3172
  * @return {?}
3116
3173
  */
@@ -3246,6 +3303,7 @@ var FHUploadComponent = /** @class */ (function () {
3246
3303
  * @param {?} p_label
3247
3304
  * @param {?=} p_tipo
3248
3305
  * @param {?=} programma_da_eseguire
3306
+ * @param {?=} allow_delete
3249
3307
  * @return {?}
3250
3308
  */
3251
3309
  FHUploadComponent.prototype.init = /**
@@ -3254,11 +3312,13 @@ var FHUploadComponent = /** @class */ (function () {
3254
3312
  * @param {?} p_label
3255
3313
  * @param {?=} p_tipo
3256
3314
  * @param {?=} programma_da_eseguire
3315
+ * @param {?=} allow_delete
3257
3316
  * @return {?}
3258
3317
  */
3259
- function (p_app, p_k, p_label, p_tipo, programma_da_eseguire) {
3318
+ function (p_app, p_k, p_label, p_tipo, programma_da_eseguire, allow_delete) {
3260
3319
  if (p_tipo === void 0) { p_tipo = ""; }
3261
3320
  if (programma_da_eseguire === void 0) { programma_da_eseguire = ""; }
3321
+ if (allow_delete === void 0) { allow_delete = false; }
3262
3322
  this.App = p_app;
3263
3323
  this.K = p_k;
3264
3324
  this.label = p_label;
@@ -3267,6 +3327,7 @@ var FHUploadComponent = /** @class */ (function () {
3267
3327
  this.b_edit_loaded = false;
3268
3328
  this.descrizione = "";
3269
3329
  this.programma_da_eseguire = programma_da_eseguire;
3330
+ this.allow_delete = allow_delete;
3270
3331
  this.ref_allegato();
3271
3332
  };
3272
3333
  /**
@@ -3298,6 +3359,7 @@ var FHUploadComponent = /** @class */ (function () {
3298
3359
  /** @type {?} */
3299
3360
  var a = data.result_data;
3300
3361
  if (a.length > 0) {
3362
+ _this.id = a[0].id;
3301
3363
  _this.descrizione = a[0].descrizione;
3302
3364
  _this.file_name = a[0].Filename;
3303
3365
  _this.label_b = "" + a[0].Filename + " - " + a[0].Filesize + "";
@@ -3309,7 +3371,7 @@ var FHUploadComponent = /** @class */ (function () {
3309
3371
  FHUploadComponent.decorators = [
3310
3372
  { type: Component, args: [{
3311
3373
  selector: 'FHUpload',
3312
- template: "\n \n <div *ngIf=\"loading\" fxLayout=\"row\">\n WAIT\n </div>\n <div *ngIf=\"enabled && !loading\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-form-field [hidden]=\"!show_descri\" class=\"field_style\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}} {{fixed_label}}</mat-label>\n <input matInput type=\"text\" name=\"descrizione\" [(ngModel)]=\"descrizione\"\n >\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\n <div style=\"width:140px\" fxLayout=\"row\" fxLayoutAlign=\"start start\">\n <input type=\"file\" multiple ng2FileSelect [uploader]=\"uploader\" name=\"file-fh{{App}}\" id=\"file-fh{{App}}\" class=\"inputfile inputfile-fh\" />\n <label for=\"file-fh{{App}}\" style=\"width:210px\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"17\" viewBox=\"0 0 20 17\"><path 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\"/></svg><span style=\"font-size: 10px\">&nbsp;&nbsp;&nbsp;Upload</span></label>\n </div>\n <div fxLayout=\"row\" fxLayoutAlign=\"start start\">\n <button mat-raised-button *ngIf=\"b_edit_loaded\" (click)=\"download_all()\">{{label_b}}</button>\n </div>\n </div>\n <div *ngIf=\"!enabled\">\n <label>{{label}}:</label>{{descrizione}}\n </div>\n <div *ngIf=\"!b_ini\" style=\"color:#ff0000\"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n ",
3374
+ template: "\n \n <div *ngIf=\"loading\" fxLayout=\"row\">\n WAIT\n </div>\n <div *ngIf=\"enabled && !loading\" fxLayout=\"row\" fxLayoutAlign=\"start center\">\n <mat-form-field [hidden]=\"!show_descri\" class=\"field_style\" appearance=\"outline\" floatLabel=\"always\"><mat-label>{{label}} {{fixed_label}}</mat-label>\n <input matInput type=\"text\" name=\"descrizione\" [(ngModel)]=\"descrizione\"\n >\n </mat-form-field>\n &nbsp;&nbsp;&nbsp;&nbsp;\n <div style=\"width:140px\" fxLayout=\"row\" fxLayoutAlign=\"start start\">\n <input type=\"file\" multiple ng2FileSelect [uploader]=\"uploader\" name=\"file-fh{{App}}\" id=\"file-fh{{App}}\" class=\"inputfile inputfile-fh\" />\n <label for=\"file-fh{{App}}\" style=\"width:210px\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"17\" viewBox=\"0 0 20 17\"><path 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\"/></svg><span style=\"font-size: 12px\">&nbsp;&nbsp;&nbsp;Upload</span></label>\n </div>\n <div fxLayout=\"row\" fxLayoutAlign=\"start start\">\n <button mat-raised-button *ngIf=\"b_edit_loaded\" (click)=\"download_all()\" style=\"font-size: 12px\">{{label_b}}</button>&nbsp;&nbsp;&nbsp;\n <button mat-raised-button *ngIf=\"id!=null && allow_delete\" (click)=\"del_doc()\" color=\"warn\">\n <mat-icon>delete</mat-icon>&nbsp;&nbsp;&nbsp;{{'ELIMINA' | translate}}\n </button>\n </div>\n </div>\n <div *ngIf=\"!enabled\" fxLayout=\"row\">\n <label>{{label}}:</label>{{descrizione}}\n <button mat-raised-button *ngIf=\"b_edit_loaded\" (click)=\"download_all()\" style=\"font-size: 12px\">{{label_b}}</button>\n\n </div>\n <div *ngIf=\"!b_ini\" style=\"color:#ff0000\"><b>ATTENZIONE COMPONENTE NON INIZIALIZZATO</b></div>\n ",
3313
3375
  styles: ["\n\n "]
3314
3376
  }] }
3315
3377
  ];