@acorex/components 6.5.9 → 6.5.11

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.
@@ -15637,11 +15637,39 @@ class AXUploadFileComponent extends AXBaseComponent {
15637
15637
  this.injectionService = injectionService;
15638
15638
  this.rendrer = rendrer;
15639
15639
  this.cdr = cdr;
15640
+ this.contentType = 'image';
15640
15641
  this.size = "md";
15641
15642
  this.type = 'inline';
15642
15643
  this.disabled = false;
15643
15644
  this.onLoad = new EventEmitter();
15644
15645
  this.onProgress = new EventEmitter();
15646
+ this.onRemove = new EventEmitter();
15647
+ this.fileTypes = [
15648
+ {
15649
+ type: 'image',
15650
+ accept: ['image/gif', 'image/jpeg', 'image/png'],
15651
+ },
15652
+ {
15653
+ type: 'audio',
15654
+ accept: ['audio/mp3'],
15655
+ },
15656
+ {
15657
+ type: 'ebook',
15658
+ accept: ['application/pdf'],
15659
+ },
15660
+ {
15661
+ type: 'excel',
15662
+ accept: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
15663
+ },
15664
+ {
15665
+ type: 'video',
15666
+ accept: ['video/*'],
15667
+ },
15668
+ {
15669
+ type: 'video/image',
15670
+ accept: ['image/gif', 'image/jpeg', 'image/png', 'video/*'],
15671
+ },
15672
+ ];
15645
15673
  this.files = [];
15646
15674
  this.fileName = '';
15647
15675
  }
@@ -15655,10 +15683,13 @@ class AXUploadFileComponent extends AXBaseComponent {
15655
15683
  this.fileInput.nativeElement.value = null;
15656
15684
  }
15657
15685
  open() {
15658
- this.fileInput.nativeElement.click();
15686
+ this.fileInput.nativeElement.click({ accept: this.accessTypes });
15659
15687
  }
15660
15688
  remove() {
15689
+ this.fileInput.nativeElement.value = '';
15661
15690
  this.files = [];
15691
+ this.fileName = null;
15692
+ this.onRemove.emit();
15662
15693
  }
15663
15694
  ngAfterViewInit() {
15664
15695
  if (this.dropRef != null) {
@@ -15761,13 +15792,18 @@ class AXUploadFileComponent extends AXBaseComponent {
15761
15792
  reader.readAsDataURL(file);
15762
15793
  this.files.push(file);
15763
15794
  }
15795
+ get accessTypes() {
15796
+ return this.fileTypes.find((item) => item.type == this.contentType).accept;
15797
+ }
15764
15798
  }
15765
15799
  AXUploadFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXUploadFileComponent, deps: [{ token: i0.ElementRef }, { token: i1$2.AXRenderService }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
15766
- AXUploadFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AXUploadFileComponent, selector: "ax-upload-file", inputs: { dropRef: "dropRef", progressRef: "progressRef", label: "label", size: "size", type: "type", template: "template", disabled: "disabled" }, outputs: { onLoad: "onLoad", onProgress: "onProgress" }, host: { styleAttribute: "display: block; width:100%; position: relative" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<input #fileInput type=\"file\" accept=\"image/*\" style=\"display: none;\" (change)=\"onFileChange($event)\" />\r\n\r\n<ng-container *ngIf=\"type == 'inline'; else elseTemplate\">\r\n <ax-form-group size=\"{{size}}\">\r\n <ax-text-box [value]=\"fileName\" readonly=\"true\" [disabled]=\"disabled\"></ax-text-box>\r\n <ax-button type=\"blank light\" icon=\"far fa-times\" (click)=\"remove()\" *ngIf=\"fileName\" [tabIndex]=\"-1\">\r\n </ax-button>\r\n <ax-button type=\"primary blank\" icon=\"far fa-upload\" (click)=\"open()\" [disabled]=\"disabled\" [tabIndex]=\"-1\">\r\n </ax-button>\r\n </ax-form-group>\r\n</ng-container>\r\n\r\n<ng-template #elseTemplate>\r\n <div class=\"ax upload-file-box\" (click)=\"open()\" #dropRef>\r\n </div>\r\n</ng-template>", components: [{ type: AXFormGroupComponent, selector: "ax-form-group", inputs: ["size"] }, { type: AXTextBoxComponent, selector: "ax-text-box", inputs: ["mask", "type", "showMask", "maxLength", "maskGuid", "maskPlaceholder", "maskKeepCharPositions"] }, { type: AXButtonComponent, selector: "ax-button", inputs: ["type", "icon", "submitBehavior", "cancelBehavior", "block", "loading", "selected"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
15800
+ AXUploadFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: AXUploadFileComponent, selector: "ax-upload-file", inputs: { contentType: "contentType", dropRef: "dropRef", progressRef: "progressRef", label: "label", size: "size", type: "type", template: "template", disabled: "disabled" }, outputs: { onLoad: "onLoad", onProgress: "onProgress", onRemove: "onRemove" }, host: { styleAttribute: "display: block; width:100%; position: relative" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<input #fileInput type=\"file\" [accept]=\"accessTypes.join(',')\" style=\"display: none;\" (change)=\"onFileChange($event)\" />\r\n\r\n<ng-container *ngIf=\"type == 'inline'; else elseTemplate\">\r\n <ax-form-group size=\"{{size}}\">\r\n <ax-text-box [value]=\"fileName\" readonly=\"true\" [disabled]=\"disabled\"></ax-text-box>\r\n <ax-button type=\"blank light\" icon=\"far fa-times\" (click)=\"remove()\" *ngIf=\"fileName\" [tabIndex]=\"-1\">\r\n </ax-button>\r\n <ax-button type=\"primary blank\" icon=\"far fa-upload\" (click)=\"open()\" [disabled]=\"disabled\" [tabIndex]=\"-1\">\r\n </ax-button>\r\n </ax-form-group>\r\n</ng-container>\r\n\r\n<ng-template #elseTemplate>\r\n <div class=\"ax upload-file-box\" (click)=\"open()\" #dropRef>\r\n </div>\r\n</ng-template>\r\n", components: [{ type: AXFormGroupComponent, selector: "ax-form-group", inputs: ["size"] }, { type: AXTextBoxComponent, selector: "ax-text-box", inputs: ["mask", "type", "showMask", "maxLength", "maskGuid", "maskPlaceholder", "maskKeepCharPositions"] }, { type: AXButtonComponent, selector: "ax-button", inputs: ["type", "icon", "submitBehavior", "cancelBehavior", "block", "loading", "selected"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
15767
15801
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXUploadFileComponent, decorators: [{
15768
15802
  type: Component,
15769
- args: [{ selector: 'ax-upload-file', encapsulation: ViewEncapsulation.None, host: { style: 'display: block; width:100%; position: relative' }, template: "<input #fileInput type=\"file\" accept=\"image/*\" style=\"display: none;\" (change)=\"onFileChange($event)\" />\r\n\r\n<ng-container *ngIf=\"type == 'inline'; else elseTemplate\">\r\n <ax-form-group size=\"{{size}}\">\r\n <ax-text-box [value]=\"fileName\" readonly=\"true\" [disabled]=\"disabled\"></ax-text-box>\r\n <ax-button type=\"blank light\" icon=\"far fa-times\" (click)=\"remove()\" *ngIf=\"fileName\" [tabIndex]=\"-1\">\r\n </ax-button>\r\n <ax-button type=\"primary blank\" icon=\"far fa-upload\" (click)=\"open()\" [disabled]=\"disabled\" [tabIndex]=\"-1\">\r\n </ax-button>\r\n </ax-form-group>\r\n</ng-container>\r\n\r\n<ng-template #elseTemplate>\r\n <div class=\"ax upload-file-box\" (click)=\"open()\" #dropRef>\r\n </div>\r\n</ng-template>" }]
15770
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.AXRenderService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { dropRef: [{
15803
+ args: [{ selector: 'ax-upload-file', encapsulation: ViewEncapsulation.None, host: { style: 'display: block; width:100%; position: relative' }, template: "<input #fileInput type=\"file\" [accept]=\"accessTypes.join(',')\" style=\"display: none;\" (change)=\"onFileChange($event)\" />\r\n\r\n<ng-container *ngIf=\"type == 'inline'; else elseTemplate\">\r\n <ax-form-group size=\"{{size}}\">\r\n <ax-text-box [value]=\"fileName\" readonly=\"true\" [disabled]=\"disabled\"></ax-text-box>\r\n <ax-button type=\"blank light\" icon=\"far fa-times\" (click)=\"remove()\" *ngIf=\"fileName\" [tabIndex]=\"-1\">\r\n </ax-button>\r\n <ax-button type=\"primary blank\" icon=\"far fa-upload\" (click)=\"open()\" [disabled]=\"disabled\" [tabIndex]=\"-1\">\r\n </ax-button>\r\n </ax-form-group>\r\n</ng-container>\r\n\r\n<ng-template #elseTemplate>\r\n <div class=\"ax upload-file-box\" (click)=\"open()\" #dropRef>\r\n </div>\r\n</ng-template>\r\n" }]
15804
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.AXRenderService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { contentType: [{
15805
+ type: Input
15806
+ }], dropRef: [{
15771
15807
  type: Input
15772
15808
  }], progressRef: [{
15773
15809
  type: Input
@@ -15788,6 +15824,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
15788
15824
  type: Output
15789
15825
  }], onProgress: [{
15790
15826
  type: Output
15827
+ }], onRemove: [{
15828
+ type: Output
15791
15829
  }] } });
15792
15830
 
15793
15831
  class AXUploadFileModule {