@@ -242,7 +242,6 @@ export class PoUploadComponent extends PoUploadBaseComponent implements AfterVie
242242 return false ;
243243 }
244244
245- // retorna se o status do arquivo é diferente de enviado
246245 isAllowCancelEvent ( status : PoUploadStatus ) {
247246 return status !== PoUploadStatus . Uploaded ;
248247 }
@@ -253,7 +252,6 @@ export class PoUploadComponent extends PoUploadBaseComponent implements AfterVie
253252 }
254253 }
255254
256- // Função disparada ao selecionar algum arquivo.
257255 onFileChange ( event ) : void {
258256 // necessário este tratamento quando para IE, pois nele o change é disparado quando o campo é limpado também
259257 if ( this . calledByCleanInputValue ) {
@@ -277,7 +275,6 @@ export class PoUploadComponent extends PoUploadBaseComponent implements AfterVie
277275 }
278276 }
279277
280- // Remove o arquivo passado por parâmetro da lista dos arquivos correntes.
281278 removeFile ( file ) : void {
282279 const index = this . currentFiles . indexOf ( file ) ;
283280 this . currentFiles . splice ( index , 1 ) ;
@@ -360,7 +357,6 @@ export class PoUploadComponent extends PoUploadBaseComponent implements AfterVie
360357 return ! ! this . additionalHelpTooltip || this . isAdditionalHelpEventTriggered ( ) ;
361358 }
362359
363- // Caso o componente estiver no modo AutoUpload, o arquivo também será removido da lista.
364360 stopUpload ( file : PoUploadFile ) {
365361 this . uploadService . stopRequestByFile ( file , ( ) => {
366362 if ( this . autoUpload ) {
@@ -376,7 +372,6 @@ export class PoUploadComponent extends PoUploadBaseComponent implements AfterVie
376372 return file . uid ;
377373 }
378374
379- // Envia os arquivos passados por parâmetro, exceto os que já foram enviados ao serviço.
380375 uploadFiles ( files : Array < PoUploadFile > ) {
381376 const filesFiltered = files . filter ( file => file . status !== PoUploadStatus . Uploaded ) ;
382377 this . uploadService . upload (
@@ -424,20 +419,17 @@ export class PoUploadComponent extends PoUploadBaseComponent implements AfterVie
424419 return document . activeElement === this . uploadButton . buttonElement . nativeElement ;
425420 }
426421
427- // função disparada na resposta do sucesso ou error
428422 private responseHandler ( file : PoUploadFile , status : PoUploadStatus ) {
429423 file . status = status ;
430424 file . percent = 100 ;
431425 this . cd . markForCheck ( ) ;
432426 }
433427
434- // método responsável por setar os argumentos do i18nPipe de acordo com a restrição.
435428 private setPipeArguments ( literalAttributes : string , literalArguments ?) {
436429 const pipeArguments = this . i18nPipe . transform ( this . literals [ literalAttributes ] , literalArguments ) ;
437430 this . notification . information ( pipeArguments ) ;
438431 }
439432
440- // Função disparada ao parar um envio de arquivo.
441433 private stopUploadHandler ( file : PoUploadFile ) {
442434 file . status = PoUploadStatus . None ;
443435 file . percent = 0 ;
@@ -454,20 +446,17 @@ export class PoUploadComponent extends PoUploadBaseComponent implements AfterVie
454446 }
455447 }
456448
457- // Atualiza o ngModel para os arquivos passados por parâmetro.
458449 private updateModel ( files : Array < PoUploadFile > ) {
459450 const modelFiles : Array < PoUploadFile > = this . mapCleanUploadFiles ( files ) ;
460451 this . onModelChange ? this . onModelChange ( modelFiles ) : this . ngModelChange . emit ( modelFiles ) ;
461452 }
462453
463- // Função disparada enquanto o arquivo está sendo enviado ao serviço.
464454 private uploadingHandler ( file : any , percent : number ) {
465455 file . status = PoUploadStatus . Uploading ;
466456 file . percent = percent ;
467457 this . cd . markForCheck ( ) ;
468458 }
469459
470- // retorna os objetos do array sem as propriedades: percent e displayName
471460 private mapCleanUploadFiles ( files : Array < PoUploadFile > ) : Array < PoUploadFile > {
472461 const mapedByUploadFile = progressFile => {
473462 const { percent, displayName, ...uploadFile } = progressFile ;
0 commit comments