@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.
@@ -15253,13 +15253,16 @@ class AXTreeViewComponent extends AXBaseComponent {
15253
15253
  }
15254
15254
  getLevel(item) {
15255
15255
  return new Promise((resolve, reject) => {
15256
+ debugger;
15256
15257
  if (item.parentNode) {
15257
15258
  this.levelCount = this.levelCount + 1;
15258
- this.getLevel(item.parentNode);
15259
+ this.getLevel(item.parentNode).then((res) => {
15260
+ resolve(this.levelCount);
15261
+ });
15259
15262
  }
15260
15263
  else {
15261
15264
  this.levelCount = this.levelCount + 1;
15262
- return;
15265
+ resolve(this.levelCount);
15263
15266
  }
15264
15267
  });
15265
15268
  }
@@ -15358,8 +15361,10 @@ class AXTreeViewComponent extends AXBaseComponent {
15358
15361
  if (n.includes(result[i][this.keyField])) {
15359
15362
  if (result[i][this.hasChildField] == true) {
15360
15363
  this.levelCount = 0;
15364
+ debugger;
15361
15365
  this.getLevel(result[i]).then((resLevel) => {
15362
- if (this.checkParents == false && this.checkChilds == false && result[i].length == this.levelCount) {
15366
+ debugger;
15367
+ if (this.checkParents == false && this.checkChilds == false && n.length == this.levelCount) {
15363
15368
  //select parent when check child and check parent is false TODO check this Action
15364
15369
  this.selectItem(result[i]);
15365
15370
  }
@@ -15697,11 +15702,38 @@ class AXUploadFileComponent extends AXBaseComponent {
15697
15702
  this.injectionService = injectionService;
15698
15703
  this.rendrer = rendrer;
15699
15704
  this.cdr = cdr;
15705
+ this.contentType = 'image';
15700
15706
  this.size = "md";
15701
15707
  this.type = 'inline';
15702
15708
  this.disabled = false;
15703
15709
  this.onLoad = new EventEmitter();
15704
15710
  this.onProgress = new EventEmitter();
15711
+ this.fileTypes = [
15712
+ {
15713
+ type: 'image',
15714
+ accept: ['image/gif', 'image/jpeg', 'image/png'],
15715
+ },
15716
+ {
15717
+ type: 'audio',
15718
+ accept: ['audio/mp3'],
15719
+ },
15720
+ {
15721
+ type: 'ebook',
15722
+ accept: ['application/pdf'],
15723
+ },
15724
+ {
15725
+ type: 'excel',
15726
+ accept: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
15727
+ },
15728
+ {
15729
+ type: 'video',
15730
+ accept: ['video/*'],
15731
+ },
15732
+ {
15733
+ type: 'video/image',
15734
+ accept: ['image/gif', 'image/jpeg', 'image/png', 'video/*'],
15735
+ },
15736
+ ];
15705
15737
  this.files = [];
15706
15738
  this.fileName = '';
15707
15739
  }
@@ -15715,10 +15747,13 @@ class AXUploadFileComponent extends AXBaseComponent {
15715
15747
  this.fileInput.nativeElement.value = null;
15716
15748
  }
15717
15749
  open() {
15718
- this.fileInput.nativeElement.click();
15750
+ this.fileInput.nativeElement.click({ accept: this.accessTypes });
15719
15751
  }
15720
15752
  remove() {
15753
+ this.fileInput.nativeElement.value = '';
15721
15754
  this.files = [];
15755
+ this.fileName = null;
15756
+ this.cdr.detectChanges();
15722
15757
  }
15723
15758
  ngAfterViewInit() {
15724
15759
  if (this.dropRef != null) {
@@ -15821,13 +15856,18 @@ class AXUploadFileComponent extends AXBaseComponent {
15821
15856
  reader.readAsDataURL(file);
15822
15857
  this.files.push(file);
15823
15858
  }
15859
+ get accessTypes() {
15860
+ return this.fileTypes.find((item) => item.type == this.contentType).accept;
15861
+ }
15824
15862
  }
15825
15863
  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 });
15826
- 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 });
15864
+ 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 });
15827
15865
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: AXUploadFileComponent, decorators: [{
15828
15866
  type: Component,
15829
- 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>" }]
15830
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.AXRenderService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { dropRef: [{
15867
+ 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" }]
15868
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$2.AXRenderService }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { contentType: [{
15869
+ type: Input
15870
+ }], dropRef: [{
15831
15871
  type: Input
15832
15872
  }], progressRef: [{
15833
15873
  type: Input