@acorex/components 6.5.8 → 6.5.10

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.
@@ -15188,13 +15188,16 @@ class AXTreeViewComponent extends AXBaseComponent {
15188
15188
  }
15189
15189
  getLevel(item) {
15190
15190
  return new Promise((resolve, reject) => {
15191
+ debugger;
15191
15192
  if (item.parentNode) {
15192
15193
  this.levelCount = this.levelCount + 1;
15193
- this.getLevel(item.parentNode);
15194
+ this.getLevel(item.parentNode).then((res) => {
15195
+ resolve(this.levelCount);
15196
+ });
15194
15197
  }
15195
15198
  else {
15196
15199
  this.levelCount = this.levelCount + 1;
15197
- return;
15200
+ resolve(this.levelCount);
15198
15201
  }
15199
15202
  });
15200
15203
  }
@@ -15293,8 +15296,10 @@ class AXTreeViewComponent extends AXBaseComponent {
15293
15296
  if (n.includes(result[i][this.keyField])) {
15294
15297
  if (result[i][this.hasChildField] == true) {
15295
15298
  this.levelCount = 0;
15299
+ debugger;
15296
15300
  this.getLevel(result[i]).then((resLevel) => {
15297
- if (this.checkParents == false && this.checkChilds == false && result[i].length == this.levelCount) {
15301
+ debugger;
15302
+ if (this.checkParents == false && this.checkChilds == false && n.length == this.levelCount) {
15298
15303
  //select parent when check child and check parent is false TODO check this Action
15299
15304
  this.selectItem(result[i]);
15300
15305
  }
@@ -15632,11 +15637,38 @@ class AXUploadFileComponent extends AXBaseComponent {
15632
15637
  this.injectionService = injectionService;
15633
15638
  this.rendrer = rendrer;
15634
15639
  this.cdr = cdr;
15640
+ this.contentType = 'image';
15635
15641
  this.size = "md";
15636
15642
  this.type = 'inline';
15637
15643
  this.disabled = false;
15638
15644
  this.onLoad = new EventEmitter();
15639
15645
  this.onProgress = new EventEmitter();
15646
+ this.fileTypes = [
15647
+ {
15648
+ type: 'image',
15649
+ accept: ['image/gif', 'image/jpeg', 'image/png'],
15650
+ },
15651
+ {
15652
+ type: 'audio',
15653
+ accept: ['audio/mp3'],
15654
+ },
15655
+ {
15656
+ type: 'ebook',
15657
+ accept: ['application/pdf'],
15658
+ },
15659
+ {
15660
+ type: 'excel',
15661
+ accept: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
15662
+ },
15663
+ {
15664
+ type: 'video',
15665
+ accept: ['video/*'],
15666
+ },
15667
+ {
15668
+ type: 'video/image',
15669
+ accept: ['image/gif', 'image/jpeg', 'image/png', 'video/*'],
15670
+ },
15671
+ ];
15640
15672
  this.files = [];
15641
15673
  this.fileName = '';
15642
15674
  }
@@ -15650,10 +15682,13 @@ class AXUploadFileComponent extends AXBaseComponent {
15650
15682
  this.fileInput.nativeElement.value = null;
15651
15683
  }
15652
15684
  open() {
15653
- this.fileInput.nativeElement.click();
15685
+ this.fileInput.nativeElement.click({ accept: this.accessTypes });
15654
15686
  }
15655
15687
  remove() {
15688
+ this.fileInput.nativeElement.value = '';
15656
15689
  this.files = [];
15690
+ this.fileName = null;
15691
+ this.cdr.detectChanges();
15657
15692
  }
15658
15693
  ngAfterViewInit() {
15659
15694
  if (this.dropRef != null) {
@@ -15756,13 +15791,18 @@ class AXUploadFileComponent extends AXBaseComponent {
15756
15791
  reader.readAsDataURL(file);
15757
15792
  this.files.push(file);
15758
15793
  }
15794
+ get accessTypes() {
15795
+ return this.fileTypes.find((item) => item.type == this.contentType).accept;
15796
+ }
15759
15797
  }
15760
15798
  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 });
15761
- 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 });
15799
+ 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" }, 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 });
15762
15800
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXUploadFileComponent, decorators: [{
15763
15801
  type: Component,
15764
- 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>" }]
15765
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.AXRenderService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { dropRef: [{
15802
+ 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" }]
15803
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.AXRenderService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { contentType: [{
15804
+ type: Input
15805
+ }], dropRef: [{
15766
15806
  type: Input
15767
15807
  }], progressRef: [{
15768
15808
  type: Input