@seniorsistemas/angular-components 17.1.8 → 17.2.0

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.
Files changed (65) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +875 -115
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/file-upload/file-upload.component.d.ts +7 -2
  6. package/components/file-upload/models/file-upload-permissions.d.ts +6 -0
  7. package/components/file-upload/models/index.d.ts +1 -0
  8. package/components/tiered-menu/components/tiered-menu/tiered-menu.component.d.ts +28 -0
  9. package/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.d.ts +2 -0
  10. package/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.d.ts +14 -0
  11. package/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.d.ts +21 -0
  12. package/components/tiered-menu/index.d.ts +3 -0
  13. package/components/tiered-menu/models/index.d.ts +2 -0
  14. package/components/tiered-menu/models/tiered-menu-item-data.d.ts +7 -0
  15. package/components/tiered-menu/models/tiered-menu-item-internal-data.d.ts +10 -0
  16. package/components/tiered-menu/tiered-menu.directive.d.ts +37 -0
  17. package/components/tiered-menu/tiered-menu.event.service.d.ts +18 -0
  18. package/components/tiered-menu/tiered-menu.module.d.ts +2 -0
  19. package/components/tiered-menu/tiered-menu.service.d.ts +10 -0
  20. package/esm2015/components/file-upload/file-upload.component.js +13 -5
  21. package/esm2015/components/file-upload/file-upload.module.js +2 -2
  22. package/esm2015/components/file-upload/models/file-upload-permissions.js +12 -0
  23. package/esm2015/components/file-upload/models/index.js +2 -1
  24. package/esm2015/components/tiered-menu/components/tiered-menu/tiered-menu.component.js +219 -0
  25. package/esm2015/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.js +13 -0
  26. package/esm2015/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.js +68 -0
  27. package/esm2015/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.js +131 -0
  28. package/esm2015/components/tiered-menu/index.js +3 -0
  29. package/esm2015/components/tiered-menu/models/index.js +1 -0
  30. package/esm2015/components/tiered-menu/models/tiered-menu-item-data.js +1 -0
  31. package/esm2015/components/tiered-menu/models/tiered-menu-item-internal-data.js +1 -0
  32. package/esm2015/components/tiered-menu/tiered-menu.directive.js +212 -0
  33. package/esm2015/components/tiered-menu/tiered-menu.event.service.js +39 -0
  34. package/esm2015/components/tiered-menu/tiered-menu.module.js +35 -0
  35. package/esm2015/components/tiered-menu/tiered-menu.service.js +39 -0
  36. package/esm2015/components/tooltip/tooltip.directive.js +2 -2
  37. package/esm2015/public-api.js +2 -1
  38. package/esm2015/seniorsistemas-angular-components.js +7 -1
  39. package/esm5/components/file-upload/file-upload.component.js +13 -5
  40. package/esm5/components/file-upload/file-upload.module.js +2 -2
  41. package/esm5/components/file-upload/models/file-upload-permissions.js +12 -0
  42. package/esm5/components/file-upload/models/index.js +2 -1
  43. package/esm5/components/tiered-menu/components/tiered-menu/tiered-menu.component.js +224 -0
  44. package/esm5/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.js +16 -0
  45. package/esm5/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.js +70 -0
  46. package/esm5/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.js +133 -0
  47. package/esm5/components/tiered-menu/index.js +3 -0
  48. package/esm5/components/tiered-menu/models/index.js +1 -0
  49. package/esm5/components/tiered-menu/models/tiered-menu-item-data.js +1 -0
  50. package/esm5/components/tiered-menu/models/tiered-menu-item-internal-data.js +1 -0
  51. package/esm5/components/tiered-menu/tiered-menu.directive.js +216 -0
  52. package/esm5/components/tiered-menu/tiered-menu.event.service.js +40 -0
  53. package/esm5/components/tiered-menu/tiered-menu.module.js +38 -0
  54. package/esm5/components/tiered-menu/tiered-menu.service.js +44 -0
  55. package/esm5/components/tooltip/tooltip.directive.js +2 -2
  56. package/esm5/public-api.js +2 -1
  57. package/esm5/seniorsistemas-angular-components.js +7 -1
  58. package/fesm2015/seniorsistemas-angular-components.js +840 -113
  59. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  60. package/fesm5/seniorsistemas-angular-components.js +871 -119
  61. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  62. package/package.json +1 -1
  63. package/public-api.d.ts +1 -0
  64. package/seniorsistemas-angular-components.d.ts +6 -0
  65. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -687,7 +687,7 @@
687
687
  };
688
688
  TooltipDirective.prototype.showTooltip = function () {
689
689
  if (this.componentRef !== null) {
690
- this.componentRef.instance.visible = true;
690
+ this.componentRef.instance.visible = this.visible;
691
691
  window.addEventListener('mousemove', this.boundOnWindowMouseMoveFunction);
692
692
  }
693
693
  };
@@ -4329,119 +4329,6 @@
4329
4329
  return EmptyStateModule;
4330
4330
  }());
4331
4331
 
4332
-
4333
- (function (ValidateErrors) {
4334
- ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
4335
- ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
4336
- ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
4337
- })(exports.ValidateErrors || (exports.ValidateErrors = {}));
4338
-
4339
- var Breakpoints = {
4340
- SM_MIN: 0,
4341
- SM_MAX: 767,
4342
- MD_MIN: 768,
4343
- MD_MAX: 991,
4344
- LG_MIN: 992,
4345
- LG_MAX: 1199,
4346
- XL_MIN: 1200,
4347
- XL_MAX: Infinity,
4348
- };
4349
-
4350
- var ExportUtils = /** @class */ (function () {
4351
- function ExportUtils() {
4352
- throw new Error("Classe não deve ser instanciada.");
4353
- }
4354
- ExportUtils.addClass = function (element, className) {
4355
- element.nativeElement.className = element.nativeElement.className + " " + className;
4356
- };
4357
- ExportUtils.removeClass = function (element, className) {
4358
- if (element.nativeElement.className.includes(className)) {
4359
- element.nativeElement.className = element.nativeElement.className.replace(className, "");
4360
- }
4361
- };
4362
- ExportUtils.exportCSV = function (columns, data, csvSeparator, documentName) {
4363
- var _this = this;
4364
- if (columns === void 0) { columns = []; }
4365
- if (data === void 0) { data = []; }
4366
- if (csvSeparator === void 0) { csvSeparator = ";"; }
4367
- if (documentName === void 0) { documentName = "download"; }
4368
- var csv = "\ufeff";
4369
- columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
4370
- csv += "\"" + (column.header || column.field) + "\"";
4371
- if (i < columns.length - 1)
4372
- csv += csvSeparator;
4373
- });
4374
- data.forEach(function (record) {
4375
- csv += "\n";
4376
- columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
4377
- var cellData;
4378
- if (Array.isArray(column.field)) {
4379
- var fieldValues = column.field.map(function (col) { return _this.resolveFieldData(record, col); });
4380
- cellData = fieldValues
4381
- .flat()
4382
- .filter(function (value) { return value !== null && value !== undefined; })
4383
- .join(column.separator);
4384
- }
4385
- else {
4386
- cellData = _this.resolveFieldData(record, column.field);
4387
- }
4388
- if (cellData != null)
4389
- cellData = String(cellData).replace(/"/g, "\"\"");
4390
- else
4391
- cellData = "";
4392
- csv += "\"" + cellData + "\"";
4393
- if (i < columns.length - 1)
4394
- csv += csvSeparator;
4395
- });
4396
- });
4397
- var blob = new Blob([csv], {
4398
- type: "text/csv;charset=utf-8;",
4399
- });
4400
- if (window.navigator.msSaveOrOpenBlob)
4401
- navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
4402
- else {
4403
- var link = document.createElement("a");
4404
- link.style.display = "none";
4405
- document.body.appendChild(link);
4406
- if (link.download !== undefined) {
4407
- link.setAttribute("href", URL.createObjectURL(blob));
4408
- link.setAttribute("download", documentName + ".csv");
4409
- link.click();
4410
- }
4411
- else {
4412
- csv = "data:text/csv;charset=utf-8," + csv;
4413
- window.open(encodeURI(csv));
4414
- }
4415
- document.body.removeChild(link);
4416
- }
4417
- };
4418
- ExportUtils.resolveFieldData = function (data, field) {
4419
- if (data && field) {
4420
- if (this.isFunction(field))
4421
- return field(data);
4422
- else if (field.indexOf(".") == -1)
4423
- return data[field];
4424
- else {
4425
- var fields = field.split(".");
4426
- var value = data;
4427
- for (var i = 0, len = fields.length; i < len; ++i) {
4428
- if (value == null) {
4429
- return null;
4430
- }
4431
- value = value[fields[i]];
4432
- }
4433
- return value;
4434
- }
4435
- }
4436
- else
4437
- return null;
4438
- };
4439
- ExportUtils.isFunction = function (obj) {
4440
- return !!(obj && obj.constructor && obj.call && obj.apply);
4441
- };
4442
- return ExportUtils;
4443
- }());
4444
-
4445
4332
  /**
4446
4333
  * Formats a JSON response to a JS object
4447
4334
  * @param response The response to format
@@ -4703,12 +4590,140 @@
4703
4590
  return FileUploadService;
4704
4591
  }());
4705
4592
 
4593
+ var Breakpoints = {
4594
+ SM_MIN: 0,
4595
+ SM_MAX: 767,
4596
+ MD_MIN: 768,
4597
+ MD_MAX: 991,
4598
+ LG_MIN: 992,
4599
+ LG_MAX: 1199,
4600
+ XL_MIN: 1200,
4601
+ XL_MAX: Infinity,
4602
+ };
4603
+
4604
+ var ExportUtils = /** @class */ (function () {
4605
+ function ExportUtils() {
4606
+ throw new Error("Classe não deve ser instanciada.");
4607
+ }
4608
+ ExportUtils.addClass = function (element, className) {
4609
+ element.nativeElement.className = element.nativeElement.className + " " + className;
4610
+ };
4611
+ ExportUtils.removeClass = function (element, className) {
4612
+ if (element.nativeElement.className.includes(className)) {
4613
+ element.nativeElement.className = element.nativeElement.className.replace(className, "");
4614
+ }
4615
+ };
4616
+ ExportUtils.exportCSV = function (columns, data, csvSeparator, documentName) {
4617
+ var _this = this;
4618
+ if (columns === void 0) { columns = []; }
4619
+ if (data === void 0) { data = []; }
4620
+ if (csvSeparator === void 0) { csvSeparator = ";"; }
4621
+ if (documentName === void 0) { documentName = "download"; }
4622
+ var csv = "\ufeff";
4623
+ columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
4624
+ csv += "\"" + (column.header || column.field) + "\"";
4625
+ if (i < columns.length - 1)
4626
+ csv += csvSeparator;
4627
+ });
4628
+ data.forEach(function (record) {
4629
+ csv += "\n";
4630
+ columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
4631
+ var cellData;
4632
+ if (Array.isArray(column.field)) {
4633
+ var fieldValues = column.field.map(function (col) { return _this.resolveFieldData(record, col); });
4634
+ cellData = fieldValues
4635
+ .flat()
4636
+ .filter(function (value) { return value !== null && value !== undefined; })
4637
+ .join(column.separator);
4638
+ }
4639
+ else {
4640
+ cellData = _this.resolveFieldData(record, column.field);
4641
+ }
4642
+ if (cellData != null)
4643
+ cellData = String(cellData).replace(/"/g, "\"\"");
4644
+ else
4645
+ cellData = "";
4646
+ csv += "\"" + cellData + "\"";
4647
+ if (i < columns.length - 1)
4648
+ csv += csvSeparator;
4649
+ });
4650
+ });
4651
+ var blob = new Blob([csv], {
4652
+ type: "text/csv;charset=utf-8;",
4653
+ });
4654
+ if (window.navigator.msSaveOrOpenBlob)
4655
+ navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
4656
+ else {
4657
+ var link = document.createElement("a");
4658
+ link.style.display = "none";
4659
+ document.body.appendChild(link);
4660
+ if (link.download !== undefined) {
4661
+ link.setAttribute("href", URL.createObjectURL(blob));
4662
+ link.setAttribute("download", documentName + ".csv");
4663
+ link.click();
4664
+ }
4665
+ else {
4666
+ csv = "data:text/csv;charset=utf-8," + csv;
4667
+ window.open(encodeURI(csv));
4668
+ }
4669
+ document.body.removeChild(link);
4670
+ }
4671
+ };
4672
+ ExportUtils.resolveFieldData = function (data, field) {
4673
+ if (data && field) {
4674
+ if (this.isFunction(field))
4675
+ return field(data);
4676
+ else if (field.indexOf(".") == -1)
4677
+ return data[field];
4678
+ else {
4679
+ var fields = field.split(".");
4680
+ var value = data;
4681
+ for (var i = 0, len = fields.length; i < len; ++i) {
4682
+ if (value == null) {
4683
+ return null;
4684
+ }
4685
+ value = value[fields[i]];
4686
+ }
4687
+ return value;
4688
+ }
4689
+ }
4690
+ else
4691
+ return null;
4692
+ };
4693
+ ExportUtils.isFunction = function (obj) {
4694
+ return !!(obj && obj.constructor && obj.call && obj.apply);
4695
+ };
4696
+ return ExportUtils;
4697
+ }());
4698
+
4699
+
4700
+ (function (ValidateErrors) {
4701
+ ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
4702
+ ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
4703
+ ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
4704
+ })(exports.ValidateErrors || (exports.ValidateErrors = {}));
4705
+
4706
+ var FileUploadPermissions;
4707
+ (function (FileUploadPermissions) {
4708
+ FileUploadPermissions["Add"] = "add";
4709
+ FileUploadPermissions["Read"] = "read";
4710
+ FileUploadPermissions["Remove"] = "remove";
4711
+ })(FileUploadPermissions || (FileUploadPermissions = {}));
4712
+ var ALL_PERMISSIONS = [
4713
+ FileUploadPermissions.Add,
4714
+ FileUploadPermissions.Read,
4715
+ FileUploadPermissions.Remove,
4716
+ ];
4717
+
4706
4718
  var moment$3 = moment_;
4707
4719
  var FileUploadComponent = /** @class */ (function () {
4708
4720
  function FileUploadComponent(sanitizer, fileUploadService, translate) {
4709
4721
  this.sanitizer = sanitizer;
4710
4722
  this.fileUploadService = fileUploadService;
4711
4723
  this.translate = translate;
4724
+ this.ADD_PERMISSION = FileUploadPermissions.Add;
4725
+ this.READ_PERMISSION = FileUploadPermissions.Read;
4726
+ this.REMOVE_PERMISSION = FileUploadPermissions.Remove;
4712
4727
  this.id = "s-file-upload-" + FileUploadComponent_1.nextId++;
4713
4728
  this.chooseLabel = "Anexar arquivos";
4714
4729
  this.removeLabel = "Remover";
@@ -4718,6 +4733,7 @@
4718
4733
  this.ariaLabelProgress = "Carregando arquivo";
4719
4734
  this.disabled = false;
4720
4735
  this.showFileUploadDate = false;
4736
+ this.permissions = ALL_PERMISSIONS;
4721
4737
  this.uploadHandler = new core.EventEmitter();
4722
4738
  this.removeFile = new core.EventEmitter();
4723
4739
  this.cancelUpload = new core.EventEmitter();
@@ -4944,6 +4960,9 @@
4944
4960
  __decorate([
4945
4961
  core.Input()
4946
4962
  ], FileUploadComponent.prototype, "showFileUploadDate", void 0);
4963
+ __decorate([
4964
+ core.Input()
4965
+ ], FileUploadComponent.prototype, "permissions", void 0);
4947
4966
  __decorate([
4948
4967
  core.Input()
4949
4968
  ], FileUploadComponent.prototype, "files", null);
@@ -4968,7 +4987,7 @@
4968
4987
  FileUploadComponent = FileUploadComponent_1 = __decorate([
4969
4988
  core.Component({
4970
4989
  selector: "s-file-upload",
4971
- template: "<div\n [id]=\"id\"\n class=\"s-fileupload\">\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id+'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileSelect($event.dataTransfer\n ? $event.dataTransfer.files\n : $event.target.files)\"> \n <s-button\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel\"\n (onClick)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\" \n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\">\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\">\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"s-fileupload-list-file-name\"\n role=\"gridcell\">\n <ng-container *ngTemplateOutlet=\"file.savedFile || file.progress === 100\n ? descriptionUrl\n : description; context: {\n $implicit: file,\n index: i\n }\">\n </ng-container>\n <span *ngIf=\"modifiedDate\" class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\">\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{ 'width': '250px', 'background-color': '#d8d8d8', 'border-radius': '0px', 'height': '14px'}\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\" \n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </span>\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelSuccess || successTooltip\"\n [pTooltip]=\"successTooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n <span\n *ngIf=\"file.error?.message\" \n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\">\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\">\n {{cancelLabel}}\n </a>\n <a\n *ngIf=\"!file.isUploading && !(disabled || !!formGroup?.disabled)\"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"ariaLabelRemove || removeLabel\">\n {{removeLabel}}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i = index>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">{{file.name}}\n </a>\n <a\n style=\"display: none;\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor>\n </a>\n</ng-template>\n\n<ng-template\n #description\n let-file>\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">\n {{file.name}}\n </span>\n</ng-template>\n",
4990
+ template: "<div\n [id]=\"id\"\n class=\"s-fileupload\">\n <div class=\"s-fileupload-choose\">\n <input\n #inputUpload\n [id]=\"id+'input-upload'\"\n type=\"file\"\n name=\"file\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileSelect($event.dataTransfer\n ? $event.dataTransfer.files\n : $event.target.files)\"> \n <s-button\n *ngIf=\"permissions.includes(ADD_PERMISSION)\"\n [id]=\"id + 'upload-button'\"\n [label]=\"chooseLabel\"\n (onClick)=\"inputUpload.click()\"\n priority=\"primary\"\n [disabled]=\"disabled || !!formGroup?.disabled\"\n [auxiliary]=\"false\">\n </s-button>\n </div>\n\n <section\n *ngIf=\"files.length\" \n [id]=\"id + 'fileupload-list'\"\n class=\"s-fileupload-list\"\n role=\"grid\">\n <ng-container *ngFor=\"let file of files; let i = index\">\n <div\n class=\"s-fileupload-list-file\"\n role=\"row\">\n <div\n [id]=\"id + '-file-' + i + '-name'\"\n class=\"s-fileupload-list-file-name\"\n role=\"gridcell\">\n <ng-container *ngTemplateOutlet=\"permissions.includes(READ_PERMISSION) && file.savedFile || file.progress === 100\n ? descriptionUrl\n : description; context: {\n $implicit: file,\n index: i\n }\">\n </ng-container>\n <span *ngIf=\"modifiedDate\" class=\"s-fileupload-list-file-name-date\">{{ modifiedDate }}</span>\n </div>\n <div\n class=\"s-fileupload-list-file-status\"\n role=\"gridcell\">\n <p-progressBar\n *ngIf=\"file.isUploading && !isSmallDevice\"\n [style]=\"{ 'width': '250px', 'background-color': '#d8d8d8', 'border-radius': '0px', 'height': '14px'}\"\n [value]=\"file.progress\"\n [showValue]=\"false\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </p-progressBar>\n <span\n *ngIf=\"file.isUploading && isSmallDevice\" \n [id]=\"id + '-file-' + i + '-spin'\"\n class=\"fas fa-circle-notch fa-spin\"\n [attr.aria-label]=\"ariaLabelProgress\">\n </span>\n <span\n *ngIf=\"!file.isUploading && !file.error && file.progress === 100\"\n [id]=\"id + '-file-' + i + '-check'\"\n class=\"fas fa-check\"\n role=\"alert\"\n [attr.aria-label]=\"ariaLabelSuccess || successTooltip\"\n [pTooltip]=\"successTooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n <span\n *ngIf=\"file.error?.message\" \n [id]=\"id + '-file-' + i + '-error'\"\n class=\"fas fa-times\"\n role=\"alert\"\n [pTooltip]=\"file.error?.message\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [appendTo]=\"'body'\">\n </span>\n </div>\n <div\n class=\"s-fileupload-list-file-actions\"\n role=\"gridcell\">\n <a\n *ngIf=\"file.isUploading\"\n [id]=\"id + '-file-' + i + '-cancel'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onCancelUpload(i)\">\n {{cancelLabel}}\n </a>\n <a\n *ngIf=\"permissions.includes(REMOVE_PERMISSION) && !file.isUploading && !(disabled || !!formGroup?.disabled)\"\n role=\"button\"\n tabindex=\"0\"\n [id]=\"id + '-file-' + i + '-remove'\"\n class=\"s-fileupload-list-file-actions-action\"\n (click)=\"onRemoveFile(file)\"\n [attr.aria-label]=\"ariaLabelRemove || removeLabel\">\n {{removeLabel}}\n </a>\n </div>\n </div>\n </ng-container>\n </section>\n</div>\n\n<ng-template\n #descriptionUrl\n let-file\n let-i = index>\n <a\n [id]=\"id + '-file-' + i + '-name-link'\"\n tabindex=\"0\"\n (click)=\"onDowloadFile(i)\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">{{file.name}}\n </a>\n <a\n style=\"display: none;\"\n [href]=\"file.objectURL\"\n target=\"_blank\"\n download\n #anchor>\n </a>\n</ng-template>\n\n<ng-template\n #description\n let-file>\n <span\n tabindex=\"0\"\n [attr.aria-label]=\"ariaLabelFileName || file.name\">\n {{file.name}}\n </span>\n</ng-template>\n",
4972
4991
  styles: [".s-fileupload .s-fileupload-choose{position:relative;margin:15px 0;width:-webkit-max-content;width:max-content}.s-fileupload input[type=file]{display:none}.s-fileupload-list{border:1px solid #ccc}.s-fileupload-list-file:not(:first-child){border-top:1px solid #ccc}.s-fileupload-list .s-fileupload-list-file{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between;padding:15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-item-align:center;align-self:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name .s-fileupload-list-file-name-date{font-size:.75rem;color:#999}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name>a{cursor:pointer;text-decoration:none}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}.s-fileupload-list .s-fileupload-list-file .fas.fa-circle-notch{color:#d8d8d8;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-check{color:#0c9348;font-size:12px}.s-fileupload-list .s-fileupload-list-file .fas.fa-times{color:#c13018;font-size:12px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin-top:15px;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;width:100%}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action{text-decoration:none;color:#428bca}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :focus,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action :visited,.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions a.s-fileupload-list-file-actions-action:hover{text-decoration:none}@media (min-width:768px){.s-fileupload-list .s-fileupload-list-file{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-name{width:auto;-ms-flex-positive:2;flex-grow:2}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-status{margin:0 15px}.s-fileupload-list .s-fileupload-list-file .s-fileupload-list-file-actions{margin:0;width:auto}}"]
4973
4992
  })
4974
4993
  ], FileUploadComponent);
@@ -14310,6 +14329,739 @@
14310
14329
  return CodeEditorModule;
14311
14330
  }());
14312
14331
 
14332
+ var TieredMenuEventService = /** @class */ (function () {
14333
+ function TieredMenuEventService() {
14334
+ this.incrementCurrentItemEvent = new core.EventEmitter();
14335
+ this.decrementCurrentItemEvent = new core.EventEmitter();
14336
+ this.closeAllMenusEvent = new core.EventEmitter();
14337
+ this.selectItemEvent = new core.EventEmitter();
14338
+ this.openItemMenuEvent = new core.EventEmitter();
14339
+ this.closeItemMenuEvent = new core.EventEmitter();
14340
+ this.createMenuEvent = new core.EventEmitter();
14341
+ }
14342
+ TieredMenuEventService.prototype.emitIncrementCurrentItemEvent = function () {
14343
+ this.incrementCurrentItemEvent.emit();
14344
+ };
14345
+ TieredMenuEventService.prototype.emitDecrementCurrentItemEvent = function () {
14346
+ this.decrementCurrentItemEvent.emit();
14347
+ };
14348
+ TieredMenuEventService.prototype.emitCloseAllMenusEvent = function () {
14349
+ this.closeAllMenusEvent.emit();
14350
+ };
14351
+ TieredMenuEventService.prototype.emitSelectItemEvent = function (item) {
14352
+ this.selectItemEvent.emit(item);
14353
+ };
14354
+ TieredMenuEventService.prototype.emitOpenItemMenuEvent = function (item) {
14355
+ this.openItemMenuEvent.emit(item);
14356
+ };
14357
+ TieredMenuEventService.prototype.emitCloseItemMenuEvent = function (item) {
14358
+ this.closeItemMenuEvent.emit(item);
14359
+ };
14360
+ TieredMenuEventService.prototype.emitCreateMenuEvent = function (item) {
14361
+ this.createMenuEvent.emit(item);
14362
+ };
14363
+ TieredMenuEventService = __decorate([
14364
+ core.Injectable()
14365
+ ], TieredMenuEventService);
14366
+ return TieredMenuEventService;
14367
+ }());
14368
+
14369
+ var TieredMenuService = /** @class */ (function () {
14370
+ function TieredMenuService() {
14371
+ }
14372
+ TieredMenuService.prototype.normalizeData = function (items, parent) {
14373
+ var _this = this;
14374
+ return items.map(function (i) {
14375
+ if (i.submenu) {
14376
+ i.submenu = _this.normalizeData(i.submenu, i);
14377
+ }
14378
+ i.id = "id-" + Math.random().toString(36).substring(2, 9) + "-" + Date.now().toString(36);
14379
+ i.parent = parent;
14380
+ i.isOpen = false;
14381
+ return i;
14382
+ });
14383
+ };
14384
+ TieredMenuService.prototype.markAllItemsAsClosed = function (items) {
14385
+ var _this = this;
14386
+ return items.map(function (item) {
14387
+ if (item.submenu) {
14388
+ item.submenu = _this.markAllItemsAsClosed(item.submenu);
14389
+ }
14390
+ item.isOpen = false;
14391
+ return item;
14392
+ });
14393
+ };
14394
+ TieredMenuService.prototype.searchTheHierarchy = function (item1, item2) {
14395
+ var itemAux = item2;
14396
+ while (itemAux) {
14397
+ if (itemAux === item1) {
14398
+ return true;
14399
+ }
14400
+ itemAux = itemAux.parent;
14401
+ }
14402
+ return false;
14403
+ };
14404
+ TieredMenuService = __decorate([
14405
+ core.Injectable()
14406
+ ], TieredMenuService);
14407
+ return TieredMenuService;
14408
+ }());
14409
+
14410
+ var TieredMenuNestedComponent = /** @class */ (function () {
14411
+ function TieredMenuNestedComponent(tieredMenuService, _tieredMenuEventService) {
14412
+ this.tieredMenuService = tieredMenuService;
14413
+ this._tieredMenuEventService = _tieredMenuEventService;
14414
+ this.top = 0;
14415
+ this.maxHeight = 0;
14416
+ this._unsubscribe$ = new rxjs.Subject();
14417
+ }
14418
+ TieredMenuNestedComponent.prototype.ngOnInit = function () {
14419
+ this.tieredMenuService.currentItems = this.items;
14420
+ this._subscribeEvents();
14421
+ };
14422
+ TieredMenuNestedComponent.prototype.ngOnDestroy = function () {
14423
+ this._unsubscribe$.next();
14424
+ this._unsubscribe$.complete();
14425
+ };
14426
+ TieredMenuNestedComponent.prototype._incrementCurItem = function () {
14427
+ if (!this.tieredMenuService.currentItem) {
14428
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14429
+ return;
14430
+ }
14431
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
14432
+ if (curIndex < this.tieredMenuService.currentItems.length) {
14433
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14434
+ }
14435
+ else {
14436
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14437
+ }
14438
+ if (this.tieredMenuService.currentItem.divider) {
14439
+ this._incrementCurItem();
14440
+ }
14441
+ };
14442
+ TieredMenuNestedComponent.prototype._decrementCurItem = function () {
14443
+ if (!this.tieredMenuService.currentItem) {
14444
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14445
+ return;
14446
+ }
14447
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
14448
+ if (curIndex >= 0) {
14449
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14450
+ }
14451
+ else {
14452
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
14453
+ }
14454
+ if (this.tieredMenuService.currentItem.divider) {
14455
+ this._decrementCurItem();
14456
+ }
14457
+ };
14458
+ TieredMenuNestedComponent.prototype._closeItem = function (item) {
14459
+ var _a;
14460
+ var itemAux = this._lastOpenItem;
14461
+ while (itemAux && itemAux != item) {
14462
+ itemAux.isOpen = false;
14463
+ itemAux = itemAux.parent;
14464
+ }
14465
+ item.isOpen = false;
14466
+ this.tieredMenuService.currentItem = itemAux !== null && itemAux !== void 0 ? itemAux : this.tieredMenuService.items[0];
14467
+ this.tieredMenuService.currentItems = ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.submenu) || this.tieredMenuService.items;
14468
+ };
14469
+ TieredMenuNestedComponent.prototype._openItem = function (item) {
14470
+ if (item === null || item === void 0 ? void 0 : item.submenu) {
14471
+ item.isOpen = true;
14472
+ this.tieredMenuService.currentItems = item.submenu;
14473
+ // Only has focus if there has already been interaction.
14474
+ if (this.tieredMenuService.currentItem) {
14475
+ this.tieredMenuService.currentItem = item.submenu[0];
14476
+ }
14477
+ this._lastOpenItem = item;
14478
+ }
14479
+ };
14480
+ TieredMenuNestedComponent.prototype._subscribeEvents = function () {
14481
+ var _this = this;
14482
+ this._tieredMenuEventService.incrementCurrentItemEvent
14483
+ .pipe(operators.takeUntil(this._unsubscribe$))
14484
+ .subscribe(function () {
14485
+ _this._incrementCurItem();
14486
+ });
14487
+ this._tieredMenuEventService.decrementCurrentItemEvent
14488
+ .pipe(operators.takeUntil(this._unsubscribe$))
14489
+ .subscribe(function () {
14490
+ _this._decrementCurItem();
14491
+ });
14492
+ this._tieredMenuEventService.selectItemEvent
14493
+ .pipe(operators.takeUntil(this._unsubscribe$))
14494
+ .subscribe(function (item) {
14495
+ if (item.command) {
14496
+ item.command();
14497
+ // Close all menus after the item was selected.
14498
+ _this._tieredMenuEventService.emitCloseAllMenusEvent();
14499
+ }
14500
+ });
14501
+ this._tieredMenuEventService.openItemMenuEvent
14502
+ .pipe(operators.takeUntil(this._unsubscribe$))
14503
+ .subscribe(function (item) {
14504
+ var _a, _b;
14505
+ if (!_this.tieredMenuService.currentItems.includes(item)) {
14506
+ var itemAux = _this._lastOpenItem;
14507
+ while ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.parent) {
14508
+ itemAux = itemAux.parent;
14509
+ }
14510
+ _this._tieredMenuEventService.emitCloseItemMenuEvent((_b = itemAux.parent) !== null && _b !== void 0 ? _b : itemAux);
14511
+ }
14512
+ _this._lastOpenItem = item;
14513
+ _this._openItem(item);
14514
+ });
14515
+ this._tieredMenuEventService.closeItemMenuEvent
14516
+ .pipe(operators.takeUntil(this._unsubscribe$))
14517
+ .subscribe(function (item) {
14518
+ if (item) {
14519
+ _this._closeItem(item);
14520
+ }
14521
+ });
14522
+ };
14523
+ TieredMenuNestedComponent.ctorParameters = function () { return [
14524
+ { type: TieredMenuService },
14525
+ { type: TieredMenuEventService }
14526
+ ]; };
14527
+ TieredMenuNestedComponent = __decorate([
14528
+ core.Component({
14529
+ template: "<div\n class=\"menu menu--nested\"\n [ngStyle]=\"{\n 'top': top + 'px',\n 'max-height': maxHeight + 'px'\n }\">\n <ng-container *ngTemplateOutlet=\"itemsTemplate; context: { $implicit: items }\"></ng-container>\n</div>\n\n<ng-template #itemsTemplate let-items>\n <div *ngFor=\"let item of items\">\n <s-tiered-menu-item\n *ngIf=\"!item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [closeOnClick]=\"true\">\n </s-tiered-menu-item>\n\n <s-tiered-menu-divider *ngIf=\"item.divider\"></s-tiered-menu-divider>\n\n <div *ngIf=\"item.submenu && item.isOpen\">\n <div class=\"submenu\">\n <ng-container *ngTemplateOutlet=\"itemsTemplate; context: { $implicit: item.submenu }\"></ng-container>\n </div>\n </div>\n </div>\n</ng-template>\n",
14530
+ styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;min-width:176px;padding:4px 0;position:fixed;z-index:9999;overflow:auto}.menu--nested{width:90vw;margin:0 5vw}.menu .submenu{margin-left:24px}"]
14531
+ })
14532
+ ], TieredMenuNestedComponent);
14533
+ return TieredMenuNestedComponent;
14534
+ }());
14535
+
14536
+ var TieredMenuComponent = /** @class */ (function () {
14537
+ function TieredMenuComponent(_appRef, _componentFactoryResolver, _injector, tieredMenuService, _tieredMenuEventService) {
14538
+ this._appRef = _appRef;
14539
+ this._componentFactoryResolver = _componentFactoryResolver;
14540
+ this._injector = _injector;
14541
+ this.tieredMenuService = tieredMenuService;
14542
+ this._tieredMenuEventService = _tieredMenuEventService;
14543
+ this.top = 0;
14544
+ this.left = 0;
14545
+ this.menuTriggerEvent = "hover";
14546
+ this._componentRef = null;
14547
+ this._unsubscribe$ = new rxjs.Subject();
14548
+ this.destroyRequest = new core.EventEmitter();
14549
+ }
14550
+ TieredMenuComponent_1 = TieredMenuComponent;
14551
+ TieredMenuComponent.prototype.ngOnInit = function () {
14552
+ this.tieredMenuService.currentItems = this.items;
14553
+ this._subscribeEvents();
14554
+ };
14555
+ TieredMenuComponent.prototype.ngOnDestroy = function () {
14556
+ this._unsubscribe$.next();
14557
+ this._unsubscribe$.complete();
14558
+ };
14559
+ TieredMenuComponent.prototype._incrementCurItem = function () {
14560
+ if (!this.tieredMenuService.currentItem) {
14561
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14562
+ return;
14563
+ }
14564
+ else if (!this.items.includes(this.tieredMenuService.currentItem)) {
14565
+ // Checking if it is the current menu.
14566
+ return;
14567
+ }
14568
+ var currentIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
14569
+ if (currentIndex < this.tieredMenuService.currentItems.length) {
14570
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[currentIndex];
14571
+ }
14572
+ else {
14573
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14574
+ }
14575
+ if (this.tieredMenuService.currentItem.divider) {
14576
+ this._incrementCurItem();
14577
+ }
14578
+ };
14579
+ TieredMenuComponent.prototype._decrementCurItem = function () {
14580
+ if (!this.tieredMenuService.currentItem) {
14581
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14582
+ return;
14583
+ // Checking if it is the current menu.
14584
+ }
14585
+ else if (!this.items.includes(this.tieredMenuService.currentItem)) {
14586
+ return;
14587
+ }
14588
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
14589
+ if (curIndex >= 0) {
14590
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14591
+ }
14592
+ else {
14593
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
14594
+ }
14595
+ if (this.tieredMenuService.currentItem.divider) {
14596
+ this._decrementCurItem();
14597
+ }
14598
+ };
14599
+ TieredMenuComponent.prototype._createMenu = function (items, position) {
14600
+ var _this = this;
14601
+ if (!this._componentRef && items) {
14602
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent_1);
14603
+ this._componentRef = componentFactory.create(this._injector);
14604
+ this._appRef.attachView(this._componentRef.hostView);
14605
+ var domElem = this._componentRef.hostView.rootNodes[0];
14606
+ document.body.appendChild(domElem);
14607
+ // Setting the menu items.
14608
+ this._componentRef.instance.items = items;
14609
+ // Subscribe menu events.
14610
+ this._componentRef.instance.destroyRequest
14611
+ .pipe(operators.takeUntil(this._unsubscribe$))
14612
+ .subscribe(function (propagate) {
14613
+ _this._destroy(propagate);
14614
+ });
14615
+ this._menuDivElement = domElem.querySelector(".menu");
14616
+ this._setMenuPosition(position);
14617
+ }
14618
+ };
14619
+ TieredMenuComponent.prototype._destroy = function (propagate) {
14620
+ if (propagate === void 0) { propagate = true; }
14621
+ if (this._componentRef !== null) {
14622
+ this._appRef.detachView(this._componentRef.hostView);
14623
+ this._componentRef.destroy();
14624
+ this._componentRef = null;
14625
+ this._menuDivElement = null;
14626
+ }
14627
+ if (propagate) {
14628
+ this.destroyRequest.emit();
14629
+ }
14630
+ };
14631
+ TieredMenuComponent.prototype._setMenuPosition = function (position) {
14632
+ var _a;
14633
+ if (this._componentRef !== null) {
14634
+ var top_1 = position.top, right = position.right, bottom = position.bottom, left = position.left;
14635
+ // I need to calculate the height of the component because the internal elements have not been created yet.
14636
+ var menuHeight = ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) * 40;
14637
+ var menuWidth = this._menuDivElement.getBoundingClientRect().width;
14638
+ var rightFreeSpace = document.body.clientWidth - right;
14639
+ var bottomFreeSpace = document.body.clientHeight - bottom;
14640
+ if (rightFreeSpace > menuWidth) {
14641
+ this._componentRef.instance.left = right;
14642
+ }
14643
+ else {
14644
+ this._componentRef.instance.left = left - menuWidth;
14645
+ }
14646
+ if (bottomFreeSpace <= menuHeight) {
14647
+ this._componentRef.instance.top = top_1 - menuHeight;
14648
+ }
14649
+ else {
14650
+ this._componentRef.instance.top = top_1;
14651
+ }
14652
+ }
14653
+ };
14654
+ TieredMenuComponent.prototype._subscribeEvents = function () {
14655
+ var _this = this;
14656
+ // Increment current item event.
14657
+ this._tieredMenuEventService.incrementCurrentItemEvent
14658
+ .pipe(operators.takeUntil(this._unsubscribe$))
14659
+ .subscribe(function () {
14660
+ _this._incrementCurItem();
14661
+ });
14662
+ // Decrement current item event.
14663
+ this._tieredMenuEventService.decrementCurrentItemEvent
14664
+ .pipe(operators.takeUntil(this._unsubscribe$))
14665
+ .subscribe(function () {
14666
+ _this._decrementCurItem();
14667
+ });
14668
+ // Select item event.
14669
+ this._tieredMenuEventService.selectItemEvent
14670
+ .pipe(operators.takeUntil(this._unsubscribe$))
14671
+ .subscribe(function (item) {
14672
+ if (item.submenu) {
14673
+ _this._tieredMenuEventService.emitOpenItemMenuEvent(item);
14674
+ }
14675
+ else if (item.command) {
14676
+ _this._tieredMenuEventService.emitCloseAllMenusEvent();
14677
+ item.command();
14678
+ }
14679
+ });
14680
+ // Close all menus event.
14681
+ this._tieredMenuEventService.closeAllMenusEvent
14682
+ .pipe(operators.takeUntil(this._unsubscribe$))
14683
+ .subscribe(function () {
14684
+ _this._destroy();
14685
+ _this.tieredMenuService.currentItem = null;
14686
+ _this.tieredMenuService.currentItems = _this.tieredMenuService.items;
14687
+ });
14688
+ // Open item menu event.
14689
+ this._tieredMenuEventService.openItemMenuEvent
14690
+ .pipe(operators.takeUntil(this._unsubscribe$))
14691
+ .subscribe(function (item) {
14692
+ item.isOpen = false;
14693
+ if (_this.tieredMenuService.currentItem) {
14694
+ if (_this.tieredMenuService.currentItem.parent === item) {
14695
+ return;
14696
+ }
14697
+ if (!_this.tieredMenuService.searchTheHierarchy(_this.tieredMenuService.currentItem.parent, item)) {
14698
+ var itemAux = _this.tieredMenuService.currentItem;
14699
+ while (itemAux.parent !== item.parent) {
14700
+ _this._tieredMenuEventService.emitCloseItemMenuEvent(itemAux);
14701
+ itemAux = itemAux.parent;
14702
+ }
14703
+ }
14704
+ }
14705
+ if (item.submenu) {
14706
+ if (!item.isOpen) {
14707
+ var _a = document
14708
+ .querySelector("#" + item.id)
14709
+ .getBoundingClientRect(), top_2 = _a.top, right = _a.right, left = _a.left, bottom = _a.bottom;
14710
+ var position = { top: top_2, right: right, left: left, bottom: bottom };
14711
+ if (_this.items.includes(item)) {
14712
+ _this._createMenu(item.submenu, position);
14713
+ _this.tieredMenuService.currentItems = item.submenu;
14714
+ _this.tieredMenuService.currentItem = item.submenu[0];
14715
+ }
14716
+ }
14717
+ }
14718
+ });
14719
+ // Close item menu event.
14720
+ this._tieredMenuEventService.closeItemMenuEvent
14721
+ .pipe(operators.takeUntil(this._unsubscribe$))
14722
+ .subscribe(function (item) {
14723
+ var _a, _b;
14724
+ if (_this.items.includes(item)) {
14725
+ item.isOpen = false;
14726
+ _this.tieredMenuService.currentItems = ((_b = (_a = item === null || item === void 0 ? void 0 : item.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.submenu) || _this.tieredMenuService.items;
14727
+ _this.tieredMenuService.currentItem = item.parent;
14728
+ _this.destroyRequest.emit(false);
14729
+ }
14730
+ });
14731
+ };
14732
+ var TieredMenuComponent_1;
14733
+ TieredMenuComponent.ctorParameters = function () { return [
14734
+ { type: core.ApplicationRef },
14735
+ { type: core.ComponentFactoryResolver },
14736
+ { type: core.Injector },
14737
+ { type: TieredMenuService },
14738
+ { type: TieredMenuEventService }
14739
+ ]; };
14740
+ __decorate([
14741
+ core.Output()
14742
+ ], TieredMenuComponent.prototype, "destroyRequest", void 0);
14743
+ TieredMenuComponent = TieredMenuComponent_1 = __decorate([
14744
+ core.Component({
14745
+ selector: "s-tiered-menu",
14746
+ template: "<div class=\"menu\" [ngStyle]=\"{\n 'left': left + 'px',\n 'top': top + 'px'\n }\">\n\n <div *ngFor=\"let item of items\">\n <s-tiered-menu-item\n *ngIf=\"!item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n triggerEvent=\"hover\"\n [closeOnClick]=\"false\">\n </s-tiered-menu-item>\n <s-tiered-menu-divider *ngIf=\"item.divider\"></s-tiered-menu-divider>\n </div>\n</div>",
14747
+ styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column;min-width:176px;padding:4px 0;position:fixed;z-index:9999}"]
14748
+ })
14749
+ ], TieredMenuComponent);
14750
+ return TieredMenuComponent;
14751
+ }());
14752
+
14753
+ var TieredMenuDirective = /** @class */ (function () {
14754
+ function TieredMenuDirective(_elementRef, _appRef, _componentFactoryResolver, _injector, _tieredMenuEventService, _tieredMenuService) {
14755
+ this._elementRef = _elementRef;
14756
+ this._appRef = _appRef;
14757
+ this._componentFactoryResolver = _componentFactoryResolver;
14758
+ this._injector = _injector;
14759
+ this._tieredMenuEventService = _tieredMenuEventService;
14760
+ this._tieredMenuService = _tieredMenuService;
14761
+ this._componentRef = null;
14762
+ this._isNested = false;
14763
+ this._isOpen = false;
14764
+ this._unsubscribe$ = new rxjs.Subject();
14765
+ this.alwaysOpen = false;
14766
+ this.triggerEvent = "click";
14767
+ }
14768
+ TieredMenuDirective.prototype.ngOnInit = function () {
14769
+ this._tieredMenuService.items = this._tieredMenuService.normalizeData(this.items);
14770
+ this._tieredMenuService.currentItems = this._tieredMenuService.items;
14771
+ this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
14772
+ this._subscribeEvents();
14773
+ };
14774
+ TieredMenuDirective.prototype.ngAfterViewInit = function () {
14775
+ var _this = this;
14776
+ // setTimeout to create the menu after creating the elements.
14777
+ if (this.alwaysOpen) {
14778
+ setTimeout(function () {
14779
+ _this._createMenu();
14780
+ }, 0);
14781
+ }
14782
+ };
14783
+ TieredMenuDirective.prototype.ngOnDestroy = function () {
14784
+ this._unsubscribe$.next();
14785
+ this._unsubscribe$.complete();
14786
+ this._destroy();
14787
+ };
14788
+ TieredMenuDirective.prototype.onResize = function () {
14789
+ if (!this.alwaysOpen) {
14790
+ this._tieredMenuEventService.emitCloseAllMenusEvent();
14791
+ }
14792
+ };
14793
+ TieredMenuDirective.prototype.onKeydownHandler = function (event) {
14794
+ if (!this._isOpen)
14795
+ return;
14796
+ switch (event.key) {
14797
+ case "Escape":
14798
+ this._tieredMenuEventService.emitCloseAllMenusEvent();
14799
+ break;
14800
+ case " ":
14801
+ case "Enter":
14802
+ this._tieredMenuEventService.emitSelectItemEvent(this._tieredMenuService.currentItem);
14803
+ break;
14804
+ case "ArrowLeft":
14805
+ // When nested I need a reference to the current item's parent item, otherwise just the current item.
14806
+ this._tieredMenuEventService.emitCloseItemMenuEvent(this._isNested ? this._tieredMenuService.currentItem.parent : this._tieredMenuService.currentItem);
14807
+ break;
14808
+ case "ArrowRight":
14809
+ this._tieredMenuEventService.emitOpenItemMenuEvent(this._tieredMenuService.currentItem);
14810
+ break;
14811
+ case "ArrowUp":
14812
+ this._tieredMenuEventService.emitDecrementCurrentItemEvent();
14813
+ break;
14814
+ case "ArrowDown":
14815
+ this._tieredMenuEventService.emitIncrementCurrentItemEvent();
14816
+ break;
14817
+ }
14818
+ };
14819
+ TieredMenuDirective.prototype.onClick = function (event) {
14820
+ if (this.triggerEvent === "click" && this.items && this.items && !this._isOpen) {
14821
+ this._lastActiveElement = document.activeElement;
14822
+ this._createMenu();
14823
+ event.preventDefault();
14824
+ event.stopPropagation();
14825
+ }
14826
+ };
14827
+ TieredMenuDirective.prototype.onDocumentClick = function (event) {
14828
+ // Closing menu when clicked outside.
14829
+ var target = event.target;
14830
+ var clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
14831
+ if (!clickedInside) {
14832
+ this._tieredMenuEventService.emitCloseAllMenusEvent();
14833
+ }
14834
+ };
14835
+ TieredMenuDirective.prototype._createMenu = function () {
14836
+ var _a;
14837
+ if (!this._componentRef && this.items) {
14838
+ (_a = this._lastActiveElement) === null || _a === void 0 ? void 0 : _a.blur();
14839
+ this._isOpen = true;
14840
+ this._isNested = document.body.clientWidth < 600;
14841
+ this._isNested ? this._createNestedMenu() : this._createTieredMenu();
14842
+ }
14843
+ };
14844
+ TieredMenuDirective.prototype._createTieredMenu = function () {
14845
+ var _this = this;
14846
+ if (!this._componentRef && this.items) {
14847
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent);
14848
+ this._componentRef = componentFactory.create(this._injector);
14849
+ this._appRef.attachView(this._componentRef.hostView);
14850
+ var domElem = this._componentRef.hostView.rootNodes[0];
14851
+ document.body.appendChild(domElem);
14852
+ this._setMenuComponentProperties();
14853
+ this._componentRef.instance.destroyRequest
14854
+ .pipe(operators.takeUntil(this._unsubscribe$))
14855
+ .subscribe(function () {
14856
+ _this._destroy();
14857
+ });
14858
+ this._menuDivElement = domElem.querySelector(".menu");
14859
+ this._setMenuPosition();
14860
+ }
14861
+ };
14862
+ TieredMenuDirective.prototype._createNestedMenu = function () {
14863
+ if (!this._componentRef && this.items) {
14864
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuNestedComponent);
14865
+ this._componentRef = componentFactory.create(this._injector);
14866
+ this._appRef.attachView(this._componentRef.hostView);
14867
+ var domElem = this._componentRef.hostView.rootNodes[0];
14868
+ document.body.appendChild(domElem);
14869
+ this._setMenuComponentProperties();
14870
+ this._menuDivElement = domElem.querySelector(".menu");
14871
+ this._setMenuPosition();
14872
+ }
14873
+ };
14874
+ TieredMenuDirective.prototype._destroy = function () {
14875
+ var _a;
14876
+ if (this._componentRef !== null && !this.alwaysOpen) {
14877
+ this._isOpen = false;
14878
+ window.clearTimeout(this._showTimeout);
14879
+ this._appRef.detachView(this._componentRef.hostView);
14880
+ this._componentRef.destroy();
14881
+ this._componentRef = null;
14882
+ this._menuDivElement = null;
14883
+ (_a = this._lastActiveElement) === null || _a === void 0 ? void 0 : _a.focus();
14884
+ this._tieredMenuService.currentItems = this._tieredMenuService.items;
14885
+ this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
14886
+ }
14887
+ };
14888
+ TieredMenuDirective.prototype._setMenuPosition = function () {
14889
+ if (this._componentRef !== null) {
14890
+ var _a = this._elementRef.nativeElement.getBoundingClientRect(), right = _a.right, bottom = _a.bottom, left = _a.left;
14891
+ var menuWidth = this._menuDivElement.getBoundingClientRect().width;
14892
+ var rightFreeSpace = document.body.clientWidth - right;
14893
+ var topPosition = bottom + 2;
14894
+ this._componentRef.instance.top = topPosition;
14895
+ if (!this._isNested) {
14896
+ if (rightFreeSpace > menuWidth) {
14897
+ this._componentRef.instance.left = left;
14898
+ }
14899
+ else {
14900
+ this._componentRef.instance.left = left - menuWidth;
14901
+ }
14902
+ }
14903
+ else {
14904
+ // setting the maximum menu size to ensure its content is always visible. 10px margin.
14905
+ this._componentRef.instance.maxHeight = window.innerHeight - topPosition - 10;
14906
+ }
14907
+ }
14908
+ };
14909
+ TieredMenuDirective.prototype._setMenuComponentProperties = function () {
14910
+ if (this._componentRef != null) {
14911
+ this._componentRef.instance.items = this.items;
14912
+ }
14913
+ };
14914
+ TieredMenuDirective.prototype._subscribeEvents = function () {
14915
+ var _this = this;
14916
+ this._tieredMenuEventService.closeAllMenusEvent
14917
+ .pipe(operators.takeUntil(this._unsubscribe$))
14918
+ .subscribe(function () {
14919
+ _this.items = _this._tieredMenuService.markAllItemsAsClosed(_this.items);
14920
+ _this._destroy();
14921
+ });
14922
+ };
14923
+ TieredMenuDirective.ctorParameters = function () { return [
14924
+ { type: core.ElementRef },
14925
+ { type: core.ApplicationRef },
14926
+ { type: core.ComponentFactoryResolver },
14927
+ { type: core.Injector },
14928
+ { type: TieredMenuEventService },
14929
+ { type: TieredMenuService }
14930
+ ]; };
14931
+ __decorate([
14932
+ core.Input()
14933
+ ], TieredMenuDirective.prototype, "items", void 0);
14934
+ __decorate([
14935
+ core.Input()
14936
+ ], TieredMenuDirective.prototype, "alwaysOpen", void 0);
14937
+ __decorate([
14938
+ core.Input()
14939
+ ], TieredMenuDirective.prototype, "triggerEvent", void 0);
14940
+ __decorate([
14941
+ core.HostListener("window:resize")
14942
+ ], TieredMenuDirective.prototype, "onResize", null);
14943
+ __decorate([
14944
+ core.HostListener("document:keydown", ["$event"])
14945
+ ], TieredMenuDirective.prototype, "onKeydownHandler", null);
14946
+ __decorate([
14947
+ core.HostListener("click", ["$event"])
14948
+ ], TieredMenuDirective.prototype, "onClick", null);
14949
+ __decorate([
14950
+ core.HostListener("document:click", ["$event"])
14951
+ ], TieredMenuDirective.prototype, "onDocumentClick", null);
14952
+ TieredMenuDirective = __decorate([
14953
+ core.Directive({
14954
+ selector: "[sTieredMenu]",
14955
+ })
14956
+ ], TieredMenuDirective);
14957
+ return TieredMenuDirective;
14958
+ }());
14959
+
14960
+ var TieredMenuItemComponent = /** @class */ (function () {
14961
+ function TieredMenuItemComponent(_tieredMenuEventService) {
14962
+ this._tieredMenuEventService = _tieredMenuEventService;
14963
+ this.focused = false;
14964
+ this.triggerEvent = "click";
14965
+ this.closeOnClick = false;
14966
+ }
14967
+ TieredMenuItemComponent.prototype.onClick = function () {
14968
+ if (this.item.submenu) {
14969
+ if (!this.item.isOpen) {
14970
+ this._tieredMenuEventService.emitOpenItemMenuEvent(this.item);
14971
+ }
14972
+ else if (this.closeOnClick) {
14973
+ this._tieredMenuEventService.emitCloseItemMenuEvent(this.item);
14974
+ }
14975
+ }
14976
+ else {
14977
+ this._tieredMenuEventService.emitSelectItemEvent(this.item);
14978
+ }
14979
+ };
14980
+ TieredMenuItemComponent.prototype.onMouseEnter = function () {
14981
+ var _this = this;
14982
+ if (this.triggerEvent === "hover" && !this.item.isOpen) {
14983
+ this._showTimeout = window.setTimeout(function () {
14984
+ _this._tieredMenuEventService.emitOpenItemMenuEvent(_this.item);
14985
+ }, 300);
14986
+ }
14987
+ };
14988
+ TieredMenuItemComponent.prototype.onMouseLeave = function () {
14989
+ window.clearTimeout(this._showTimeout);
14990
+ };
14991
+ TieredMenuItemComponent.ctorParameters = function () { return [
14992
+ { type: TieredMenuEventService }
14993
+ ]; };
14994
+ __decorate([
14995
+ core.Input()
14996
+ ], TieredMenuItemComponent.prototype, "item", void 0);
14997
+ __decorate([
14998
+ core.Input()
14999
+ ], TieredMenuItemComponent.prototype, "focused", void 0);
15000
+ __decorate([
15001
+ core.Input()
15002
+ ], TieredMenuItemComponent.prototype, "triggerEvent", void 0);
15003
+ __decorate([
15004
+ core.Input()
15005
+ ], TieredMenuItemComponent.prototype, "closeOnClick", void 0);
15006
+ __decorate([
15007
+ core.HostListener("click"),
15008
+ core.HostListener("touchend")
15009
+ ], TieredMenuItemComponent.prototype, "onClick", null);
15010
+ __decorate([
15011
+ core.HostListener("mouseenter")
15012
+ ], TieredMenuItemComponent.prototype, "onMouseEnter", null);
15013
+ __decorate([
15014
+ core.HostListener("mouseleave")
15015
+ ], TieredMenuItemComponent.prototype, "onMouseLeave", null);
15016
+ TieredMenuItemComponent = __decorate([
15017
+ core.Component({
15018
+ selector: "s-tiered-menu-item",
15019
+ template: "<div\n [id]=\"item.id\"\n class=\"tiered-menu-item\"\n [ngClass]=\"{\n 'tiered-menu-item--open': item.isOpen,\n 'tiered-menu-item--focused': focused\n }\">\n <div class=\"tiered-menu-item-content\">\n <span class=\"icon\" [ngClass]=\"item.iconClass\"></span>\n <span class=\"label\">{{ item.label }}</span>\n </div>\n <span\n *ngIf=\"item.submenu\"\n class=\"submenu-icon\"\n [ngClass]=\"{\n 'fas': true,\n 'fa-chevron-left': item.isOpen,\n 'fa-chevron-right': !item.isOpen\n }\">\n </span>\n</div>",
15020
+ styles: [".tiered-menu-item{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:8px 16px;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.tiered-menu-item .tiered-menu-item-content .label{margin:0 12px}.tiered-menu-item:hover{background-color:#e9e6e6}.tiered-menu-item--focused{background-color:#ccc!important}.tiered-menu-item--open{background-color:#e4e2e2}"]
15021
+ })
15022
+ ], TieredMenuItemComponent);
15023
+ return TieredMenuItemComponent;
15024
+ }());
15025
+
15026
+ var TieredMenuDividerComponent = /** @class */ (function () {
15027
+ function TieredMenuDividerComponent() {
15028
+ }
15029
+ TieredMenuDividerComponent = __decorate([
15030
+ core.Component({
15031
+ selector: "s-tiered-menu-divider",
15032
+ template: "<div class=\"divider\"></div>",
15033
+ styles: [".divider{margin:2px 0;height:1px;background-color:#ccc}"]
15034
+ })
15035
+ ], TieredMenuDividerComponent);
15036
+ return TieredMenuDividerComponent;
15037
+ }());
15038
+
15039
+ var TieredMenuModule = /** @class */ (function () {
15040
+ function TieredMenuModule() {
15041
+ }
15042
+ TieredMenuModule = __decorate([
15043
+ core.NgModule({
15044
+ imports: [
15045
+ common.CommonModule,
15046
+ platformBrowser.BrowserModule,
15047
+ ],
15048
+ declarations: [
15049
+ TieredMenuDirective,
15050
+ TieredMenuComponent,
15051
+ TieredMenuNestedComponent,
15052
+ TieredMenuItemComponent,
15053
+ TieredMenuDividerComponent,
15054
+ ],
15055
+ exports: [TieredMenuDirective],
15056
+ providers: [
15057
+ TieredMenuEventService,
15058
+ TieredMenuService,
15059
+ ],
15060
+ })
15061
+ ], TieredMenuModule);
15062
+ return TieredMenuModule;
15063
+ }());
15064
+
14313
15065
  var WorkspaceSwitchComponent = /** @class */ (function () {
14314
15066
  function WorkspaceSwitchComponent(eRef) {
14315
15067
  this.eRef = eRef;
@@ -15085,6 +15837,8 @@
15085
15837
  exports.TextField = TextField;
15086
15838
  exports.ThumbnailComponent = ThumbnailComponent;
15087
15839
  exports.ThumbnailModule = ThumbnailModule;
15840
+ exports.TieredMenuDirective = TieredMenuDirective;
15841
+ exports.TieredMenuModule = TieredMenuModule;
15088
15842
  exports.TileComponent = TileComponent;
15089
15843
  exports.TileModule = TileModule;
15090
15844
  exports.TimelineComponent = TimelineComponent;
@@ -15131,6 +15885,12 @@
15131
15885
  exports.ɵcd = CodeEditorComponent;
15132
15886
  exports.ɵce = CoreFacade;
15133
15887
  exports.ɵcf = CodeMirror6Core;
15888
+ exports.ɵcg = TieredMenuEventService;
15889
+ exports.ɵch = TieredMenuService;
15890
+ exports.ɵci = TieredMenuComponent;
15891
+ exports.ɵcj = TieredMenuNestedComponent;
15892
+ exports.ɵck = TieredMenuItemComponent;
15893
+ exports.ɵcl = TieredMenuDividerComponent;
15134
15894
  exports.ɵd = LocalizedCurrencyImpurePipe;
15135
15895
  exports.ɵe = LocalizedBignumberPipe;
15136
15896
  exports.ɵf = LocalizedBignumberImpurePipe;