@seniorsistemas/angular-components 17.1.7 → 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 (68) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +880 -116
  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/button/button.component.d.ts +1 -0
  6. package/components/file-upload/file-upload.component.d.ts +7 -2
  7. package/components/file-upload/models/file-upload-permissions.d.ts +6 -0
  8. package/components/file-upload/models/index.d.ts +1 -0
  9. package/components/tiered-menu/components/tiered-menu/tiered-menu.component.d.ts +28 -0
  10. package/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.d.ts +2 -0
  11. package/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.d.ts +14 -0
  12. package/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.d.ts +21 -0
  13. package/components/tiered-menu/index.d.ts +3 -0
  14. package/components/tiered-menu/models/index.d.ts +2 -0
  15. package/components/tiered-menu/models/tiered-menu-item-data.d.ts +7 -0
  16. package/components/tiered-menu/models/tiered-menu-item-internal-data.d.ts +10 -0
  17. package/components/tiered-menu/tiered-menu.directive.d.ts +37 -0
  18. package/components/tiered-menu/tiered-menu.event.service.d.ts +18 -0
  19. package/components/tiered-menu/tiered-menu.module.d.ts +2 -0
  20. package/components/tiered-menu/tiered-menu.service.d.ts +10 -0
  21. package/esm2015/components/button/button.component.js +6 -2
  22. package/esm2015/components/file-upload/file-upload.component.js +13 -5
  23. package/esm2015/components/file-upload/file-upload.module.js +2 -2
  24. package/esm2015/components/file-upload/models/file-upload-permissions.js +12 -0
  25. package/esm2015/components/file-upload/models/index.js +2 -1
  26. package/esm2015/components/tiered-menu/components/tiered-menu/tiered-menu.component.js +219 -0
  27. package/esm2015/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.js +13 -0
  28. package/esm2015/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.js +68 -0
  29. package/esm2015/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.js +131 -0
  30. package/esm2015/components/tiered-menu/index.js +3 -0
  31. package/esm2015/components/tiered-menu/models/index.js +1 -0
  32. package/esm2015/components/tiered-menu/models/tiered-menu-item-data.js +1 -0
  33. package/esm2015/components/tiered-menu/models/tiered-menu-item-internal-data.js +1 -0
  34. package/esm2015/components/tiered-menu/tiered-menu.directive.js +212 -0
  35. package/esm2015/components/tiered-menu/tiered-menu.event.service.js +39 -0
  36. package/esm2015/components/tiered-menu/tiered-menu.module.js +35 -0
  37. package/esm2015/components/tiered-menu/tiered-menu.service.js +39 -0
  38. package/esm2015/components/tooltip/tooltip.directive.js +2 -2
  39. package/esm2015/public-api.js +2 -1
  40. package/esm2015/seniorsistemas-angular-components.js +7 -1
  41. package/esm5/components/button/button.component.js +6 -2
  42. package/esm5/components/file-upload/file-upload.component.js +13 -5
  43. package/esm5/components/file-upload/file-upload.module.js +2 -2
  44. package/esm5/components/file-upload/models/file-upload-permissions.js +12 -0
  45. package/esm5/components/file-upload/models/index.js +2 -1
  46. package/esm5/components/tiered-menu/components/tiered-menu/tiered-menu.component.js +224 -0
  47. package/esm5/components/tiered-menu/components/tiered-menu-divider/tiered-menu-divider.component.js +16 -0
  48. package/esm5/components/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.js +70 -0
  49. package/esm5/components/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.js +133 -0
  50. package/esm5/components/tiered-menu/index.js +3 -0
  51. package/esm5/components/tiered-menu/models/index.js +1 -0
  52. package/esm5/components/tiered-menu/models/tiered-menu-item-data.js +1 -0
  53. package/esm5/components/tiered-menu/models/tiered-menu-item-internal-data.js +1 -0
  54. package/esm5/components/tiered-menu/tiered-menu.directive.js +216 -0
  55. package/esm5/components/tiered-menu/tiered-menu.event.service.js +40 -0
  56. package/esm5/components/tiered-menu/tiered-menu.module.js +38 -0
  57. package/esm5/components/tiered-menu/tiered-menu.service.js +44 -0
  58. package/esm5/components/tooltip/tooltip.directive.js +2 -2
  59. package/esm5/public-api.js +2 -1
  60. package/esm5/seniorsistemas-angular-components.js +7 -1
  61. package/fesm2015/seniorsistemas-angular-components.js +845 -114
  62. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  63. package/fesm5/seniorsistemas-angular-components.js +876 -120
  64. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  65. package/package.json +1 -1
  66. package/public-api.d.ts +1 -0
  67. package/seniorsistemas-angular-components.d.ts +6 -0
  68. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -8,7 +8,7 @@ import { RouterModule, NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router } f
8
8
  import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
9
9
  import { Subject, of, from, forkJoin, throwError, ReplaySubject } from 'rxjs';
10
10
  import { takeUntil, filter, tap, map, switchMap, catchError, delay, debounceTime, repeat, finalize, take } from 'rxjs/operators';
11
- import { TieredMenu, TieredMenuModule } from 'primeng/tieredmenu';
11
+ import { TieredMenu, TieredMenuModule as TieredMenuModule$1 } from 'primeng/tieredmenu';
12
12
  import { TooltipModule as TooltipModule$1 } from 'primeng/tooltip';
13
13
  import { DomHandler } from 'primeng/dom';
14
14
  import { Calendar, CalendarModule } from 'primeng/calendar';
@@ -39,7 +39,7 @@ import { PanelModule as PanelModule$1 } from 'primeng/panel';
39
39
  import { RadioButtonModule } from 'primeng/radiobutton';
40
40
  import { SliderModule } from 'primeng/slider';
41
41
  import { ProgressBarModule as ProgressBarModule$1 } from 'primeng/progressbar';
42
- import { DomSanitizer } from '@angular/platform-browser';
42
+ import { DomSanitizer, BrowserModule } from '@angular/platform-browser';
43
43
  import Cropper from 'cropperjs';
44
44
  import * as elementResizeDetectorMaker_ from 'element-resize-detector';
45
45
  import { FocusTrapFactory, A11yModule } from '@angular/cdk/a11y';
@@ -540,7 +540,7 @@ var TooltipDirective = /** @class */ (function () {
540
540
  };
541
541
  TooltipDirective.prototype.showTooltip = function () {
542
542
  if (this.componentRef !== null) {
543
- this.componentRef.instance.visible = true;
543
+ this.componentRef.instance.visible = this.visible;
544
544
  window.addEventListener('mousemove', this.boundOnWindowMouseMoveFunction);
545
545
  }
546
546
  };
@@ -964,6 +964,7 @@ var ButtonComponent = /** @class */ (function () {
964
964
  function ButtonComponent() {
965
965
  this.minWidth = "40px";
966
966
  this.id = "s-button-" + ButtonComponent_1.nextId++;
967
+ this.tooltipPosition = "top";
967
968
  this.caret = true;
968
969
  this.baseZIndex = 0;
969
970
  this.disabled = false;
@@ -1019,6 +1020,9 @@ var ButtonComponent = /** @class */ (function () {
1019
1020
  __decorate([
1020
1021
  Input()
1021
1022
  ], ButtonComponent.prototype, "tooltip", void 0);
1023
+ __decorate([
1024
+ Input()
1025
+ ], ButtonComponent.prototype, "tooltipPosition", void 0);
1022
1026
  __decorate([
1023
1027
  Input()
1024
1028
  ], ButtonComponent.prototype, "iconClass", void 0);
@@ -1067,7 +1071,7 @@ var ButtonComponent = /** @class */ (function () {
1067
1071
  ButtonComponent = ButtonComponent_1 = __decorate([
1068
1072
  Component({
1069
1073
  selector: "s-button",
1070
- template: "<p-tieredMenu [id]=\"id + '-menu'\" [popup]=\"true\" appendTo=\"body\" [baseZIndex]=\"baseZIndex\"></p-tieredMenu>\n\n<button\n [id]=\"id\"\n [type]=\"type\"\n [class]=\"styleClass\"\n [ngClass]=\"{\n 's-button-auxiliary': auxiliary,\n 's-button-with-icon': iconClass,\n 's-button-with-text': label,\n 's-button-empty': !iconClass && !label,\n 's-button-size-default': size === 'default',\n 's-button-size-small': size === 'small',\n 's-button-priority-default': priority === 'default',\n 's-button-priority-primary': priority === 'primary',\n 's-button-priority-secondary': priority === 'secondary',\n 's-button-priority-link': priority === 'link',\n 's-button-multiple': (caret && (model && model.length)) || rightIconClass,\n 's-button-active': isOpen(),\n 's-button--slide': validateSlideButton(),\n 's-button--rotate-animation': isRotateAnimation()\n }\"\n [disabled]=\"disabled\"\n [pTooltip]=\"tooltip\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n [tooltipZIndex]=\"tooltipZIndex\"\n (click)=\"onClick.emit($event)\"\n (mouseenter)=\"updateTooltipZIndex()\"\n>\n <span \n *ngIf=\"iconClass\" \n [class]=\"iconClass\" \n [ngClass]=\"{ \n 's-button-icon': true,\n 's-button-icon-margin-right': !label && model && model.length\n }\" \n aria-hidden=\"true\">\n </span>\n <span \n *ngIf=\"label\" \n class=\"s-button-text\"\n [ngClass]=\"{\n 's-button-icon-margin-right': !!rightIconClass || (model && model.length),\n 's-button-icon-margin-left': !!iconClass\n }\">\n {{ label }}\n </span>\n <ng-content></ng-content>\n <span \n *ngIf=\"rightIconClass\" \n [class]=\"rightIconClass\" \n [ngClass]=\"{ 's-button-right-icon': true }\" \n aria-hidden=\"true\">\n </span>\n <span\n *ngIf=\"caret && (model && model.length)\" \n class=\"fa fa-fw fa-caret-down\"\n aria-hidden=\"true\">\n </span>\n</button>\n",
1074
+ template: "<p-tieredMenu [id]=\"id + '-menu'\" [popup]=\"true\" appendTo=\"body\" [baseZIndex]=\"baseZIndex\"></p-tieredMenu>\n\n<button\n [id]=\"id\"\n [type]=\"type\"\n [class]=\"styleClass\"\n [ngClass]=\"{\n 's-button-auxiliary': auxiliary,\n 's-button-with-icon': iconClass,\n 's-button-with-text': label,\n 's-button-empty': !iconClass && !label,\n 's-button-size-default': size === 'default',\n 's-button-size-small': size === 'small',\n 's-button-priority-default': priority === 'default',\n 's-button-priority-primary': priority === 'primary',\n 's-button-priority-secondary': priority === 'secondary',\n 's-button-priority-link': priority === 'link',\n 's-button-multiple': (caret && (model && model.length)) || rightIconClass,\n 's-button-active': isOpen(),\n 's-button--slide': validateSlideButton(),\n 's-button--rotate-animation': isRotateAnimation()\n }\"\n [disabled]=\"disabled\"\n [pTooltip]=\"tooltip\"\n [tooltipPosition]=\"tooltipPosition\"\n showDelay=\"500\"\n [tooltipZIndex]=\"tooltipZIndex\"\n (click)=\"onClick.emit($event)\"\n (mouseenter)=\"updateTooltipZIndex()\"\n>\n <span \n *ngIf=\"iconClass\" \n [class]=\"iconClass\" \n [ngClass]=\"{ \n 's-button-icon': true,\n 's-button-icon-margin-right': !label && model && model.length\n }\" \n aria-hidden=\"true\">\n </span>\n <span \n *ngIf=\"label\" \n class=\"s-button-text\"\n [ngClass]=\"{\n 's-button-icon-margin-right': !!rightIconClass || (model && model.length),\n 's-button-icon-margin-left': !!iconClass\n }\">\n {{ label }}\n </span>\n <ng-content></ng-content>\n <span \n *ngIf=\"rightIconClass\" \n [class]=\"rightIconClass\" \n [ngClass]=\"{ 's-button-right-icon': true }\" \n aria-hidden=\"true\">\n </span>\n <span\n *ngIf=\"caret && (model && model.length)\" \n class=\"fa fa-fw fa-caret-down\"\n aria-hidden=\"true\">\n </span>\n</button>\n",
1071
1075
  styles: ["button{-ms-flex-align:center;align-items:center;border-radius:4px;border:1px solid;cursor:pointer;font-family:\"Open Sans\",sans-serif;font-size:14px;height:34px;max-width:100%;min-width:40px;outline:0;overflow:visible;padding:5px 10px;position:relative;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;text-decoration:none;text-transform:none;vertical-align:bottom;transition:background-color .2s ease-out,color .2s ease-out,border-color .2s ease-out}button:disabled{opacity:.5;filter:Alpha(Opacity=50);background-image:none}button:disabled,button:disabled *{cursor:text!important}button.s-button-auxiliary{border-radius:20px}button.s-button-size-small{padding:0 20px;height:25px}button.s-button-with-icon.s-button-multiple,button.s-button-with-text{min-width:80px}button.s-button-with-icon.s-button-with-text.s-button-multiple{min-width:100px}button .s-button-icon,button .s-button-menu-icon,button .s-button-right-icon,button.s-button-with-icon.s-button-multiple:not(.s-button-with-text) .s-button-icon{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}button.s-button-multiple .s-button-text{display:-ms-flexbox;display:flex;-ms-flex-pack:left;justify-content:left;-ms-flex-align:left;align-items:left}button.s-button-with-icon .s-button-text{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;-ms-flex-align:right;align-items:right}.s-button-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.s-button-menu-icon{right:10px;transition:transform .2s ease-out}.s-button-icon-margin-left{margin-left:10px}.s-button-icon-margin-right{margin-right:10px}.s-button-active .s-button-menu-icon{transform:rotateX(180deg)}button,button.s-button-priority-primary{background-color:#428bca;border-color:#428bca}button .s-button-icon,button .s-button-menu-icon,button .s-button-right-icon,button .s-button-text,button.s-button-priority-primary .s-button-icon,button.s-button-priority-primary .s-button-menu-icon,button.s-button-priority-primary .s-button-right-icon,button.s-button-priority-primary .s-button-text{color:#fff}button.s-button-priority-primary:hover,button:hover{background-color:#2a6496}button.s-button-priority-primary:focus,button:focus{background-color:#2a6496;border-color:#22dce6}button.s-button-active:not(:disabled),button.s-button-priority-primary.s-button-active:not(:disabled),button.s-button-priority-primary:active:not(:disabled),button:active:not(:disabled){background-color:#245682;border-color:#245682}button.s-button-priority-secondary{background-color:#7892a1;border-color:#7892a1}button.s-button-priority-secondary .s-button-icon,button.s-button-priority-secondary .s-button-menu-icon,button.s-button-priority-secondary .s-button-right-icon,button.s-button-priority-secondary .s-button-text{color:#fff}button.s-button-priority-secondary:hover{background-color:#546b79}button.s-button-priority-secondary:focus{background-color:#546b79;border-color:#22dce6}button.s-button-priority-secondary.s-button-active:not(:disabled),button.s-button-priority-secondary:active:not(:disabled){background-color:#495e6a;border-color:#495e6a}button.s-button-priority-default{background-color:#fff;border-color:#ccc}button.s-button-priority-default .s-button-icon,button.s-button-priority-default .s-button-menu-icon,button.s-button-priority-default .s-button-right-icon,button.s-button-priority-default .s-button-text{color:#333}button.s-button-priority-default:hover{background-color:#d9d9d9}button.s-button-priority-default:focus{background-color:#d9d9d9;border-color:#22dce6}button.s-button-priority-default.s-button-active:not(:disabled),button.s-button-priority-default:active:not(:disabled){background-color:#ccc;border-color:#ccc}button.s-button-priority-link{background-color:transparent;border-color:transparent}button.s-button-priority-link .s-button-icon,button.s-button-priority-link .s-button-menu-icon,button.s-button-priority-link .s-button-right-icon,button.s-button-priority-link .s-button-text{color:#428bca}button.s-button-priority-link:hover{background-color:transparent}button.s-button-priority-link:hover .s-button-icon,button.s-button-priority-link:hover .s-button-menu-icon,button.s-button-priority-link:hover .s-button-right-icon,button.s-button-priority-link:hover .s-button-text{color:#2a6496}button.s-button-priority-link:focus{border-color:#22dce6;background-color:transparent}button.s-button-priority-link:focus .s-button-icon,button.s-button-priority-link:focus .s-button-menu-icon,button.s-button-priority-link:focus .s-button-right-icon,button.s-button-priority-link:focus .s-button-text{color:#2a6496}button.s-button-priority-link.s-button-active:not(:disabled),button.s-button-priority-link:active:not(:disabled){background-color:transparent;border-color:transparent}button.s-button-priority-link.s-button-active:not(:disabled) .s-button-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-menu-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-right-icon,button.s-button-priority-link.s-button-active:not(:disabled) .s-button-text,button.s-button-priority-link:active:not(:disabled) .s-button-icon,button.s-button-priority-link:active:not(:disabled) .s-button-menu-icon,button.s-button-priority-link:active:not(:disabled) .s-button-right-icon,button.s-button-priority-link:active:not(:disabled) .s-button-text{color:#245682}.s-button--slide.s-button-with-icon.s-button-multiple,.s-button--slide.s-button-with-text{min-width:40px}.s-button--slide .s-button-text{position:absolute;opacity:0;width:0}.s-button--slide:hover .s-button-text{transition:1s;position:relative;opacity:1;width:auto}.s-button--slide:hover.s-button--rotate-animation .s-button-icon,.s-button--slide:hover.s-button--rotate-animation .s-button-right-icon{transition:1.5s;transform:rotate(360deg)}"]
1072
1076
  })
1073
1077
  ], ButtonComponent);
@@ -1079,7 +1083,7 @@ var ButtonModule = /** @class */ (function () {
1079
1083
  }
1080
1084
  ButtonModule = __decorate([
1081
1085
  NgModule({
1082
- imports: [CommonModule, RouterModule, TieredMenuModule, TooltipModule$1],
1086
+ imports: [CommonModule, RouterModule, TieredMenuModule$1, TooltipModule$1],
1083
1087
  declarations: [ButtonComponent],
1084
1088
  exports: [ButtonComponent],
1085
1089
  })
@@ -4178,119 +4182,6 @@ var EmptyStateModule = /** @class */ (function () {
4178
4182
  return EmptyStateModule;
4179
4183
  }());
4180
4184
 
4181
- var ValidateErrors;
4182
- (function (ValidateErrors) {
4183
- ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
4184
- ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
4185
- ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
4186
- })(ValidateErrors || (ValidateErrors = {}));
4187
-
4188
- var Breakpoints = {
4189
- SM_MIN: 0,
4190
- SM_MAX: 767,
4191
- MD_MIN: 768,
4192
- MD_MAX: 991,
4193
- LG_MIN: 992,
4194
- LG_MAX: 1199,
4195
- XL_MIN: 1200,
4196
- XL_MAX: Infinity,
4197
- };
4198
-
4199
- var ExportUtils = /** @class */ (function () {
4200
- function ExportUtils() {
4201
- throw new Error("Classe não deve ser instanciada.");
4202
- }
4203
- ExportUtils.addClass = function (element, className) {
4204
- element.nativeElement.className = element.nativeElement.className + " " + className;
4205
- };
4206
- ExportUtils.removeClass = function (element, className) {
4207
- if (element.nativeElement.className.includes(className)) {
4208
- element.nativeElement.className = element.nativeElement.className.replace(className, "");
4209
- }
4210
- };
4211
- ExportUtils.exportCSV = function (columns, data, csvSeparator, documentName) {
4212
- var _this = this;
4213
- if (columns === void 0) { columns = []; }
4214
- if (data === void 0) { data = []; }
4215
- if (csvSeparator === void 0) { csvSeparator = ";"; }
4216
- if (documentName === void 0) { documentName = "download"; }
4217
- var csv = "\ufeff";
4218
- columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
4219
- csv += "\"" + (column.header || column.field) + "\"";
4220
- if (i < columns.length - 1)
4221
- csv += csvSeparator;
4222
- });
4223
- data.forEach(function (record) {
4224
- csv += "\n";
4225
- columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
4226
- var cellData;
4227
- if (Array.isArray(column.field)) {
4228
- var fieldValues = column.field.map(function (col) { return _this.resolveFieldData(record, col); });
4229
- cellData = fieldValues
4230
- .flat()
4231
- .filter(function (value) { return value !== null && value !== undefined; })
4232
- .join(column.separator);
4233
- }
4234
- else {
4235
- cellData = _this.resolveFieldData(record, column.field);
4236
- }
4237
- if (cellData != null)
4238
- cellData = String(cellData).replace(/"/g, "\"\"");
4239
- else
4240
- cellData = "";
4241
- csv += "\"" + cellData + "\"";
4242
- if (i < columns.length - 1)
4243
- csv += csvSeparator;
4244
- });
4245
- });
4246
- var blob = new Blob([csv], {
4247
- type: "text/csv;charset=utf-8;",
4248
- });
4249
- if (window.navigator.msSaveOrOpenBlob)
4250
- navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
4251
- else {
4252
- var link = document.createElement("a");
4253
- link.style.display = "none";
4254
- document.body.appendChild(link);
4255
- if (link.download !== undefined) {
4256
- link.setAttribute("href", URL.createObjectURL(blob));
4257
- link.setAttribute("download", documentName + ".csv");
4258
- link.click();
4259
- }
4260
- else {
4261
- csv = "data:text/csv;charset=utf-8," + csv;
4262
- window.open(encodeURI(csv));
4263
- }
4264
- document.body.removeChild(link);
4265
- }
4266
- };
4267
- ExportUtils.resolveFieldData = function (data, field) {
4268
- if (data && field) {
4269
- if (this.isFunction(field))
4270
- return field(data);
4271
- else if (field.indexOf(".") == -1)
4272
- return data[field];
4273
- else {
4274
- var fields = field.split(".");
4275
- var value = data;
4276
- for (var i = 0, len = fields.length; i < len; ++i) {
4277
- if (value == null) {
4278
- return null;
4279
- }
4280
- value = value[fields[i]];
4281
- }
4282
- return value;
4283
- }
4284
- }
4285
- else
4286
- return null;
4287
- };
4288
- ExportUtils.isFunction = function (obj) {
4289
- return !!(obj && obj.constructor && obj.call && obj.apply);
4290
- };
4291
- return ExportUtils;
4292
- }());
4293
-
4294
4185
  /**
4295
4186
  * Formats a JSON response to a JS object
4296
4187
  * @param response The response to format
@@ -4552,12 +4443,140 @@ var FileUploadService = /** @class */ (function () {
4552
4443
  return FileUploadService;
4553
4444
  }());
4554
4445
 
4446
+ var Breakpoints = {
4447
+ SM_MIN: 0,
4448
+ SM_MAX: 767,
4449
+ MD_MIN: 768,
4450
+ MD_MAX: 991,
4451
+ LG_MIN: 992,
4452
+ LG_MAX: 1199,
4453
+ XL_MIN: 1200,
4454
+ XL_MAX: Infinity,
4455
+ };
4456
+
4457
+ var ExportUtils = /** @class */ (function () {
4458
+ function ExportUtils() {
4459
+ throw new Error("Classe não deve ser instanciada.");
4460
+ }
4461
+ ExportUtils.addClass = function (element, className) {
4462
+ element.nativeElement.className = element.nativeElement.className + " " + className;
4463
+ };
4464
+ ExportUtils.removeClass = function (element, className) {
4465
+ if (element.nativeElement.className.includes(className)) {
4466
+ element.nativeElement.className = element.nativeElement.className.replace(className, "");
4467
+ }
4468
+ };
4469
+ ExportUtils.exportCSV = function (columns, data, csvSeparator, documentName) {
4470
+ var _this = this;
4471
+ if (columns === void 0) { columns = []; }
4472
+ if (data === void 0) { data = []; }
4473
+ if (csvSeparator === void 0) { csvSeparator = ";"; }
4474
+ if (documentName === void 0) { documentName = "download"; }
4475
+ var csv = "\ufeff";
4476
+ columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
4477
+ csv += "\"" + (column.header || column.field) + "\"";
4478
+ if (i < columns.length - 1)
4479
+ csv += csvSeparator;
4480
+ });
4481
+ data.forEach(function (record) {
4482
+ csv += "\n";
4483
+ columns.filter(function (column) { return column.exportable && column.field; }).forEach(function (column, i) {
4484
+ var cellData;
4485
+ if (Array.isArray(column.field)) {
4486
+ var fieldValues = column.field.map(function (col) { return _this.resolveFieldData(record, col); });
4487
+ cellData = fieldValues
4488
+ .flat()
4489
+ .filter(function (value) { return value !== null && value !== undefined; })
4490
+ .join(column.separator);
4491
+ }
4492
+ else {
4493
+ cellData = _this.resolveFieldData(record, column.field);
4494
+ }
4495
+ if (cellData != null)
4496
+ cellData = String(cellData).replace(/"/g, "\"\"");
4497
+ else
4498
+ cellData = "";
4499
+ csv += "\"" + cellData + "\"";
4500
+ if (i < columns.length - 1)
4501
+ csv += csvSeparator;
4502
+ });
4503
+ });
4504
+ var blob = new Blob([csv], {
4505
+ type: "text/csv;charset=utf-8;",
4506
+ });
4507
+ if (window.navigator.msSaveOrOpenBlob)
4508
+ navigator.msSaveOrOpenBlob(blob, documentName + ".csv");
4509
+ else {
4510
+ var link = document.createElement("a");
4511
+ link.style.display = "none";
4512
+ document.body.appendChild(link);
4513
+ if (link.download !== undefined) {
4514
+ link.setAttribute("href", URL.createObjectURL(blob));
4515
+ link.setAttribute("download", documentName + ".csv");
4516
+ link.click();
4517
+ }
4518
+ else {
4519
+ csv = "data:text/csv;charset=utf-8," + csv;
4520
+ window.open(encodeURI(csv));
4521
+ }
4522
+ document.body.removeChild(link);
4523
+ }
4524
+ };
4525
+ ExportUtils.resolveFieldData = function (data, field) {
4526
+ if (data && field) {
4527
+ if (this.isFunction(field))
4528
+ return field(data);
4529
+ else if (field.indexOf(".") == -1)
4530
+ return data[field];
4531
+ else {
4532
+ var fields = field.split(".");
4533
+ var value = data;
4534
+ for (var i = 0, len = fields.length; i < len; ++i) {
4535
+ if (value == null) {
4536
+ return null;
4537
+ }
4538
+ value = value[fields[i]];
4539
+ }
4540
+ return value;
4541
+ }
4542
+ }
4543
+ else
4544
+ return null;
4545
+ };
4546
+ ExportUtils.isFunction = function (obj) {
4547
+ return !!(obj && obj.constructor && obj.call && obj.apply);
4548
+ };
4549
+ return ExportUtils;
4550
+ }());
4551
+
4552
+ var ValidateErrors;
4553
+ (function (ValidateErrors) {
4554
+ ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
4555
+ ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
4556
+ ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
4557
+ })(ValidateErrors || (ValidateErrors = {}));
4558
+
4559
+ var FileUploadPermissions;
4560
+ (function (FileUploadPermissions) {
4561
+ FileUploadPermissions["Add"] = "add";
4562
+ FileUploadPermissions["Read"] = "read";
4563
+ FileUploadPermissions["Remove"] = "remove";
4564
+ })(FileUploadPermissions || (FileUploadPermissions = {}));
4565
+ var ALL_PERMISSIONS = [
4566
+ FileUploadPermissions.Add,
4567
+ FileUploadPermissions.Read,
4568
+ FileUploadPermissions.Remove,
4569
+ ];
4570
+
4555
4571
  var moment$3 = moment_;
4556
4572
  var FileUploadComponent = /** @class */ (function () {
4557
4573
  function FileUploadComponent(sanitizer, fileUploadService, translate) {
4558
4574
  this.sanitizer = sanitizer;
4559
4575
  this.fileUploadService = fileUploadService;
4560
4576
  this.translate = translate;
4577
+ this.ADD_PERMISSION = FileUploadPermissions.Add;
4578
+ this.READ_PERMISSION = FileUploadPermissions.Read;
4579
+ this.REMOVE_PERMISSION = FileUploadPermissions.Remove;
4561
4580
  this.id = "s-file-upload-" + FileUploadComponent_1.nextId++;
4562
4581
  this.chooseLabel = "Anexar arquivos";
4563
4582
  this.removeLabel = "Remover";
@@ -4567,6 +4586,7 @@ var FileUploadComponent = /** @class */ (function () {
4567
4586
  this.ariaLabelProgress = "Carregando arquivo";
4568
4587
  this.disabled = false;
4569
4588
  this.showFileUploadDate = false;
4589
+ this.permissions = ALL_PERMISSIONS;
4570
4590
  this.uploadHandler = new EventEmitter();
4571
4591
  this.removeFile = new EventEmitter();
4572
4592
  this.cancelUpload = new EventEmitter();
@@ -4793,6 +4813,9 @@ var FileUploadComponent = /** @class */ (function () {
4793
4813
  __decorate([
4794
4814
  Input()
4795
4815
  ], FileUploadComponent.prototype, "showFileUploadDate", void 0);
4816
+ __decorate([
4817
+ Input()
4818
+ ], FileUploadComponent.prototype, "permissions", void 0);
4796
4819
  __decorate([
4797
4820
  Input()
4798
4821
  ], FileUploadComponent.prototype, "files", null);
@@ -4817,7 +4840,7 @@ var FileUploadComponent = /** @class */ (function () {
4817
4840
  FileUploadComponent = FileUploadComponent_1 = __decorate([
4818
4841
  Component({
4819
4842
  selector: "s-file-upload",
4820
- 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",
4843
+ 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",
4821
4844
  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}}"]
4822
4845
  })
4823
4846
  ], FileUploadComponent);
@@ -14159,6 +14182,739 @@ var CodeEditorModule = /** @class */ (function () {
14159
14182
  return CodeEditorModule;
14160
14183
  }());
14161
14184
 
14185
+ var TieredMenuEventService = /** @class */ (function () {
14186
+ function TieredMenuEventService() {
14187
+ this.incrementCurrentItemEvent = new EventEmitter();
14188
+ this.decrementCurrentItemEvent = new EventEmitter();
14189
+ this.closeAllMenusEvent = new EventEmitter();
14190
+ this.selectItemEvent = new EventEmitter();
14191
+ this.openItemMenuEvent = new EventEmitter();
14192
+ this.closeItemMenuEvent = new EventEmitter();
14193
+ this.createMenuEvent = new EventEmitter();
14194
+ }
14195
+ TieredMenuEventService.prototype.emitIncrementCurrentItemEvent = function () {
14196
+ this.incrementCurrentItemEvent.emit();
14197
+ };
14198
+ TieredMenuEventService.prototype.emitDecrementCurrentItemEvent = function () {
14199
+ this.decrementCurrentItemEvent.emit();
14200
+ };
14201
+ TieredMenuEventService.prototype.emitCloseAllMenusEvent = function () {
14202
+ this.closeAllMenusEvent.emit();
14203
+ };
14204
+ TieredMenuEventService.prototype.emitSelectItemEvent = function (item) {
14205
+ this.selectItemEvent.emit(item);
14206
+ };
14207
+ TieredMenuEventService.prototype.emitOpenItemMenuEvent = function (item) {
14208
+ this.openItemMenuEvent.emit(item);
14209
+ };
14210
+ TieredMenuEventService.prototype.emitCloseItemMenuEvent = function (item) {
14211
+ this.closeItemMenuEvent.emit(item);
14212
+ };
14213
+ TieredMenuEventService.prototype.emitCreateMenuEvent = function (item) {
14214
+ this.createMenuEvent.emit(item);
14215
+ };
14216
+ TieredMenuEventService = __decorate([
14217
+ Injectable()
14218
+ ], TieredMenuEventService);
14219
+ return TieredMenuEventService;
14220
+ }());
14221
+
14222
+ var TieredMenuService = /** @class */ (function () {
14223
+ function TieredMenuService() {
14224
+ }
14225
+ TieredMenuService.prototype.normalizeData = function (items, parent) {
14226
+ var _this = this;
14227
+ return items.map(function (i) {
14228
+ if (i.submenu) {
14229
+ i.submenu = _this.normalizeData(i.submenu, i);
14230
+ }
14231
+ i.id = "id-" + Math.random().toString(36).substring(2, 9) + "-" + Date.now().toString(36);
14232
+ i.parent = parent;
14233
+ i.isOpen = false;
14234
+ return i;
14235
+ });
14236
+ };
14237
+ TieredMenuService.prototype.markAllItemsAsClosed = function (items) {
14238
+ var _this = this;
14239
+ return items.map(function (item) {
14240
+ if (item.submenu) {
14241
+ item.submenu = _this.markAllItemsAsClosed(item.submenu);
14242
+ }
14243
+ item.isOpen = false;
14244
+ return item;
14245
+ });
14246
+ };
14247
+ TieredMenuService.prototype.searchTheHierarchy = function (item1, item2) {
14248
+ var itemAux = item2;
14249
+ while (itemAux) {
14250
+ if (itemAux === item1) {
14251
+ return true;
14252
+ }
14253
+ itemAux = itemAux.parent;
14254
+ }
14255
+ return false;
14256
+ };
14257
+ TieredMenuService = __decorate([
14258
+ Injectable()
14259
+ ], TieredMenuService);
14260
+ return TieredMenuService;
14261
+ }());
14262
+
14263
+ var TieredMenuNestedComponent = /** @class */ (function () {
14264
+ function TieredMenuNestedComponent(tieredMenuService, _tieredMenuEventService) {
14265
+ this.tieredMenuService = tieredMenuService;
14266
+ this._tieredMenuEventService = _tieredMenuEventService;
14267
+ this.top = 0;
14268
+ this.maxHeight = 0;
14269
+ this._unsubscribe$ = new Subject();
14270
+ }
14271
+ TieredMenuNestedComponent.prototype.ngOnInit = function () {
14272
+ this.tieredMenuService.currentItems = this.items;
14273
+ this._subscribeEvents();
14274
+ };
14275
+ TieredMenuNestedComponent.prototype.ngOnDestroy = function () {
14276
+ this._unsubscribe$.next();
14277
+ this._unsubscribe$.complete();
14278
+ };
14279
+ TieredMenuNestedComponent.prototype._incrementCurItem = function () {
14280
+ if (!this.tieredMenuService.currentItem) {
14281
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14282
+ return;
14283
+ }
14284
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
14285
+ if (curIndex < this.tieredMenuService.currentItems.length) {
14286
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14287
+ }
14288
+ else {
14289
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14290
+ }
14291
+ if (this.tieredMenuService.currentItem.divider) {
14292
+ this._incrementCurItem();
14293
+ }
14294
+ };
14295
+ TieredMenuNestedComponent.prototype._decrementCurItem = function () {
14296
+ if (!this.tieredMenuService.currentItem) {
14297
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14298
+ return;
14299
+ }
14300
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
14301
+ if (curIndex >= 0) {
14302
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14303
+ }
14304
+ else {
14305
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
14306
+ }
14307
+ if (this.tieredMenuService.currentItem.divider) {
14308
+ this._decrementCurItem();
14309
+ }
14310
+ };
14311
+ TieredMenuNestedComponent.prototype._closeItem = function (item) {
14312
+ var _a;
14313
+ var itemAux = this._lastOpenItem;
14314
+ while (itemAux && itemAux != item) {
14315
+ itemAux.isOpen = false;
14316
+ itemAux = itemAux.parent;
14317
+ }
14318
+ item.isOpen = false;
14319
+ this.tieredMenuService.currentItem = itemAux !== null && itemAux !== void 0 ? itemAux : this.tieredMenuService.items[0];
14320
+ this.tieredMenuService.currentItems = ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.submenu) || this.tieredMenuService.items;
14321
+ };
14322
+ TieredMenuNestedComponent.prototype._openItem = function (item) {
14323
+ if (item === null || item === void 0 ? void 0 : item.submenu) {
14324
+ item.isOpen = true;
14325
+ this.tieredMenuService.currentItems = item.submenu;
14326
+ // Only has focus if there has already been interaction.
14327
+ if (this.tieredMenuService.currentItem) {
14328
+ this.tieredMenuService.currentItem = item.submenu[0];
14329
+ }
14330
+ this._lastOpenItem = item;
14331
+ }
14332
+ };
14333
+ TieredMenuNestedComponent.prototype._subscribeEvents = function () {
14334
+ var _this = this;
14335
+ this._tieredMenuEventService.incrementCurrentItemEvent
14336
+ .pipe(takeUntil(this._unsubscribe$))
14337
+ .subscribe(function () {
14338
+ _this._incrementCurItem();
14339
+ });
14340
+ this._tieredMenuEventService.decrementCurrentItemEvent
14341
+ .pipe(takeUntil(this._unsubscribe$))
14342
+ .subscribe(function () {
14343
+ _this._decrementCurItem();
14344
+ });
14345
+ this._tieredMenuEventService.selectItemEvent
14346
+ .pipe(takeUntil(this._unsubscribe$))
14347
+ .subscribe(function (item) {
14348
+ if (item.command) {
14349
+ item.command();
14350
+ // Close all menus after the item was selected.
14351
+ _this._tieredMenuEventService.emitCloseAllMenusEvent();
14352
+ }
14353
+ });
14354
+ this._tieredMenuEventService.openItemMenuEvent
14355
+ .pipe(takeUntil(this._unsubscribe$))
14356
+ .subscribe(function (item) {
14357
+ var _a, _b;
14358
+ if (!_this.tieredMenuService.currentItems.includes(item)) {
14359
+ var itemAux = _this._lastOpenItem;
14360
+ while ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.parent) {
14361
+ itemAux = itemAux.parent;
14362
+ }
14363
+ _this._tieredMenuEventService.emitCloseItemMenuEvent((_b = itemAux.parent) !== null && _b !== void 0 ? _b : itemAux);
14364
+ }
14365
+ _this._lastOpenItem = item;
14366
+ _this._openItem(item);
14367
+ });
14368
+ this._tieredMenuEventService.closeItemMenuEvent
14369
+ .pipe(takeUntil(this._unsubscribe$))
14370
+ .subscribe(function (item) {
14371
+ if (item) {
14372
+ _this._closeItem(item);
14373
+ }
14374
+ });
14375
+ };
14376
+ TieredMenuNestedComponent.ctorParameters = function () { return [
14377
+ { type: TieredMenuService },
14378
+ { type: TieredMenuEventService }
14379
+ ]; };
14380
+ TieredMenuNestedComponent = __decorate([
14381
+ Component({
14382
+ 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",
14383
+ 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}"]
14384
+ })
14385
+ ], TieredMenuNestedComponent);
14386
+ return TieredMenuNestedComponent;
14387
+ }());
14388
+
14389
+ var TieredMenuComponent = /** @class */ (function () {
14390
+ function TieredMenuComponent(_appRef, _componentFactoryResolver, _injector, tieredMenuService, _tieredMenuEventService) {
14391
+ this._appRef = _appRef;
14392
+ this._componentFactoryResolver = _componentFactoryResolver;
14393
+ this._injector = _injector;
14394
+ this.tieredMenuService = tieredMenuService;
14395
+ this._tieredMenuEventService = _tieredMenuEventService;
14396
+ this.top = 0;
14397
+ this.left = 0;
14398
+ this.menuTriggerEvent = "hover";
14399
+ this._componentRef = null;
14400
+ this._unsubscribe$ = new Subject();
14401
+ this.destroyRequest = new EventEmitter();
14402
+ }
14403
+ TieredMenuComponent_1 = TieredMenuComponent;
14404
+ TieredMenuComponent.prototype.ngOnInit = function () {
14405
+ this.tieredMenuService.currentItems = this.items;
14406
+ this._subscribeEvents();
14407
+ };
14408
+ TieredMenuComponent.prototype.ngOnDestroy = function () {
14409
+ this._unsubscribe$.next();
14410
+ this._unsubscribe$.complete();
14411
+ };
14412
+ TieredMenuComponent.prototype._incrementCurItem = function () {
14413
+ if (!this.tieredMenuService.currentItem) {
14414
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14415
+ return;
14416
+ }
14417
+ else if (!this.items.includes(this.tieredMenuService.currentItem)) {
14418
+ // Checking if it is the current menu.
14419
+ return;
14420
+ }
14421
+ var currentIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
14422
+ if (currentIndex < this.tieredMenuService.currentItems.length) {
14423
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[currentIndex];
14424
+ }
14425
+ else {
14426
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14427
+ }
14428
+ if (this.tieredMenuService.currentItem.divider) {
14429
+ this._incrementCurItem();
14430
+ }
14431
+ };
14432
+ TieredMenuComponent.prototype._decrementCurItem = function () {
14433
+ if (!this.tieredMenuService.currentItem) {
14434
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14435
+ return;
14436
+ // Checking if it is the current menu.
14437
+ }
14438
+ else if (!this.items.includes(this.tieredMenuService.currentItem)) {
14439
+ return;
14440
+ }
14441
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
14442
+ if (curIndex >= 0) {
14443
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14444
+ }
14445
+ else {
14446
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
14447
+ }
14448
+ if (this.tieredMenuService.currentItem.divider) {
14449
+ this._decrementCurItem();
14450
+ }
14451
+ };
14452
+ TieredMenuComponent.prototype._createMenu = function (items, position) {
14453
+ var _this = this;
14454
+ if (!this._componentRef && items) {
14455
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent_1);
14456
+ this._componentRef = componentFactory.create(this._injector);
14457
+ this._appRef.attachView(this._componentRef.hostView);
14458
+ var domElem = this._componentRef.hostView.rootNodes[0];
14459
+ document.body.appendChild(domElem);
14460
+ // Setting the menu items.
14461
+ this._componentRef.instance.items = items;
14462
+ // Subscribe menu events.
14463
+ this._componentRef.instance.destroyRequest
14464
+ .pipe(takeUntil(this._unsubscribe$))
14465
+ .subscribe(function (propagate) {
14466
+ _this._destroy(propagate);
14467
+ });
14468
+ this._menuDivElement = domElem.querySelector(".menu");
14469
+ this._setMenuPosition(position);
14470
+ }
14471
+ };
14472
+ TieredMenuComponent.prototype._destroy = function (propagate) {
14473
+ if (propagate === void 0) { propagate = true; }
14474
+ if (this._componentRef !== null) {
14475
+ this._appRef.detachView(this._componentRef.hostView);
14476
+ this._componentRef.destroy();
14477
+ this._componentRef = null;
14478
+ this._menuDivElement = null;
14479
+ }
14480
+ if (propagate) {
14481
+ this.destroyRequest.emit();
14482
+ }
14483
+ };
14484
+ TieredMenuComponent.prototype._setMenuPosition = function (position) {
14485
+ var _a;
14486
+ if (this._componentRef !== null) {
14487
+ var top_1 = position.top, right = position.right, bottom = position.bottom, left = position.left;
14488
+ // I need to calculate the height of the component because the internal elements have not been created yet.
14489
+ var menuHeight = ((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) * 40;
14490
+ var menuWidth = this._menuDivElement.getBoundingClientRect().width;
14491
+ var rightFreeSpace = document.body.clientWidth - right;
14492
+ var bottomFreeSpace = document.body.clientHeight - bottom;
14493
+ if (rightFreeSpace > menuWidth) {
14494
+ this._componentRef.instance.left = right;
14495
+ }
14496
+ else {
14497
+ this._componentRef.instance.left = left - menuWidth;
14498
+ }
14499
+ if (bottomFreeSpace <= menuHeight) {
14500
+ this._componentRef.instance.top = top_1 - menuHeight;
14501
+ }
14502
+ else {
14503
+ this._componentRef.instance.top = top_1;
14504
+ }
14505
+ }
14506
+ };
14507
+ TieredMenuComponent.prototype._subscribeEvents = function () {
14508
+ var _this = this;
14509
+ // Increment current item event.
14510
+ this._tieredMenuEventService.incrementCurrentItemEvent
14511
+ .pipe(takeUntil(this._unsubscribe$))
14512
+ .subscribe(function () {
14513
+ _this._incrementCurItem();
14514
+ });
14515
+ // Decrement current item event.
14516
+ this._tieredMenuEventService.decrementCurrentItemEvent
14517
+ .pipe(takeUntil(this._unsubscribe$))
14518
+ .subscribe(function () {
14519
+ _this._decrementCurItem();
14520
+ });
14521
+ // Select item event.
14522
+ this._tieredMenuEventService.selectItemEvent
14523
+ .pipe(takeUntil(this._unsubscribe$))
14524
+ .subscribe(function (item) {
14525
+ if (item.submenu) {
14526
+ _this._tieredMenuEventService.emitOpenItemMenuEvent(item);
14527
+ }
14528
+ else if (item.command) {
14529
+ _this._tieredMenuEventService.emitCloseAllMenusEvent();
14530
+ item.command();
14531
+ }
14532
+ });
14533
+ // Close all menus event.
14534
+ this._tieredMenuEventService.closeAllMenusEvent
14535
+ .pipe(takeUntil(this._unsubscribe$))
14536
+ .subscribe(function () {
14537
+ _this._destroy();
14538
+ _this.tieredMenuService.currentItem = null;
14539
+ _this.tieredMenuService.currentItems = _this.tieredMenuService.items;
14540
+ });
14541
+ // Open item menu event.
14542
+ this._tieredMenuEventService.openItemMenuEvent
14543
+ .pipe(takeUntil(this._unsubscribe$))
14544
+ .subscribe(function (item) {
14545
+ item.isOpen = false;
14546
+ if (_this.tieredMenuService.currentItem) {
14547
+ if (_this.tieredMenuService.currentItem.parent === item) {
14548
+ return;
14549
+ }
14550
+ if (!_this.tieredMenuService.searchTheHierarchy(_this.tieredMenuService.currentItem.parent, item)) {
14551
+ var itemAux = _this.tieredMenuService.currentItem;
14552
+ while (itemAux.parent !== item.parent) {
14553
+ _this._tieredMenuEventService.emitCloseItemMenuEvent(itemAux);
14554
+ itemAux = itemAux.parent;
14555
+ }
14556
+ }
14557
+ }
14558
+ if (item.submenu) {
14559
+ if (!item.isOpen) {
14560
+ var _a = document
14561
+ .querySelector("#" + item.id)
14562
+ .getBoundingClientRect(), top_2 = _a.top, right = _a.right, left = _a.left, bottom = _a.bottom;
14563
+ var position = { top: top_2, right: right, left: left, bottom: bottom };
14564
+ if (_this.items.includes(item)) {
14565
+ _this._createMenu(item.submenu, position);
14566
+ _this.tieredMenuService.currentItems = item.submenu;
14567
+ _this.tieredMenuService.currentItem = item.submenu[0];
14568
+ }
14569
+ }
14570
+ }
14571
+ });
14572
+ // Close item menu event.
14573
+ this._tieredMenuEventService.closeItemMenuEvent
14574
+ .pipe(takeUntil(this._unsubscribe$))
14575
+ .subscribe(function (item) {
14576
+ var _a, _b;
14577
+ if (_this.items.includes(item)) {
14578
+ item.isOpen = false;
14579
+ _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;
14580
+ _this.tieredMenuService.currentItem = item.parent;
14581
+ _this.destroyRequest.emit(false);
14582
+ }
14583
+ });
14584
+ };
14585
+ var TieredMenuComponent_1;
14586
+ TieredMenuComponent.ctorParameters = function () { return [
14587
+ { type: ApplicationRef },
14588
+ { type: ComponentFactoryResolver },
14589
+ { type: Injector },
14590
+ { type: TieredMenuService },
14591
+ { type: TieredMenuEventService }
14592
+ ]; };
14593
+ __decorate([
14594
+ Output()
14595
+ ], TieredMenuComponent.prototype, "destroyRequest", void 0);
14596
+ TieredMenuComponent = TieredMenuComponent_1 = __decorate([
14597
+ Component({
14598
+ selector: "s-tiered-menu",
14599
+ 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>",
14600
+ 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}"]
14601
+ })
14602
+ ], TieredMenuComponent);
14603
+ return TieredMenuComponent;
14604
+ }());
14605
+
14606
+ var TieredMenuDirective = /** @class */ (function () {
14607
+ function TieredMenuDirective(_elementRef, _appRef, _componentFactoryResolver, _injector, _tieredMenuEventService, _tieredMenuService) {
14608
+ this._elementRef = _elementRef;
14609
+ this._appRef = _appRef;
14610
+ this._componentFactoryResolver = _componentFactoryResolver;
14611
+ this._injector = _injector;
14612
+ this._tieredMenuEventService = _tieredMenuEventService;
14613
+ this._tieredMenuService = _tieredMenuService;
14614
+ this._componentRef = null;
14615
+ this._isNested = false;
14616
+ this._isOpen = false;
14617
+ this._unsubscribe$ = new Subject();
14618
+ this.alwaysOpen = false;
14619
+ this.triggerEvent = "click";
14620
+ }
14621
+ TieredMenuDirective.prototype.ngOnInit = function () {
14622
+ this._tieredMenuService.items = this._tieredMenuService.normalizeData(this.items);
14623
+ this._tieredMenuService.currentItems = this._tieredMenuService.items;
14624
+ this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
14625
+ this._subscribeEvents();
14626
+ };
14627
+ TieredMenuDirective.prototype.ngAfterViewInit = function () {
14628
+ var _this = this;
14629
+ // setTimeout to create the menu after creating the elements.
14630
+ if (this.alwaysOpen) {
14631
+ setTimeout(function () {
14632
+ _this._createMenu();
14633
+ }, 0);
14634
+ }
14635
+ };
14636
+ TieredMenuDirective.prototype.ngOnDestroy = function () {
14637
+ this._unsubscribe$.next();
14638
+ this._unsubscribe$.complete();
14639
+ this._destroy();
14640
+ };
14641
+ TieredMenuDirective.prototype.onResize = function () {
14642
+ if (!this.alwaysOpen) {
14643
+ this._tieredMenuEventService.emitCloseAllMenusEvent();
14644
+ }
14645
+ };
14646
+ TieredMenuDirective.prototype.onKeydownHandler = function (event) {
14647
+ if (!this._isOpen)
14648
+ return;
14649
+ switch (event.key) {
14650
+ case "Escape":
14651
+ this._tieredMenuEventService.emitCloseAllMenusEvent();
14652
+ break;
14653
+ case " ":
14654
+ case "Enter":
14655
+ this._tieredMenuEventService.emitSelectItemEvent(this._tieredMenuService.currentItem);
14656
+ break;
14657
+ case "ArrowLeft":
14658
+ // When nested I need a reference to the current item's parent item, otherwise just the current item.
14659
+ this._tieredMenuEventService.emitCloseItemMenuEvent(this._isNested ? this._tieredMenuService.currentItem.parent : this._tieredMenuService.currentItem);
14660
+ break;
14661
+ case "ArrowRight":
14662
+ this._tieredMenuEventService.emitOpenItemMenuEvent(this._tieredMenuService.currentItem);
14663
+ break;
14664
+ case "ArrowUp":
14665
+ this._tieredMenuEventService.emitDecrementCurrentItemEvent();
14666
+ break;
14667
+ case "ArrowDown":
14668
+ this._tieredMenuEventService.emitIncrementCurrentItemEvent();
14669
+ break;
14670
+ }
14671
+ };
14672
+ TieredMenuDirective.prototype.onClick = function (event) {
14673
+ if (this.triggerEvent === "click" && this.items && this.items && !this._isOpen) {
14674
+ this._lastActiveElement = document.activeElement;
14675
+ this._createMenu();
14676
+ event.preventDefault();
14677
+ event.stopPropagation();
14678
+ }
14679
+ };
14680
+ TieredMenuDirective.prototype.onDocumentClick = function (event) {
14681
+ // Closing menu when clicked outside.
14682
+ var target = event.target;
14683
+ var clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
14684
+ if (!clickedInside) {
14685
+ this._tieredMenuEventService.emitCloseAllMenusEvent();
14686
+ }
14687
+ };
14688
+ TieredMenuDirective.prototype._createMenu = function () {
14689
+ var _a;
14690
+ if (!this._componentRef && this.items) {
14691
+ (_a = this._lastActiveElement) === null || _a === void 0 ? void 0 : _a.blur();
14692
+ this._isOpen = true;
14693
+ this._isNested = document.body.clientWidth < 600;
14694
+ this._isNested ? this._createNestedMenu() : this._createTieredMenu();
14695
+ }
14696
+ };
14697
+ TieredMenuDirective.prototype._createTieredMenu = function () {
14698
+ var _this = this;
14699
+ if (!this._componentRef && this.items) {
14700
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent);
14701
+ this._componentRef = componentFactory.create(this._injector);
14702
+ this._appRef.attachView(this._componentRef.hostView);
14703
+ var domElem = this._componentRef.hostView.rootNodes[0];
14704
+ document.body.appendChild(domElem);
14705
+ this._setMenuComponentProperties();
14706
+ this._componentRef.instance.destroyRequest
14707
+ .pipe(takeUntil(this._unsubscribe$))
14708
+ .subscribe(function () {
14709
+ _this._destroy();
14710
+ });
14711
+ this._menuDivElement = domElem.querySelector(".menu");
14712
+ this._setMenuPosition();
14713
+ }
14714
+ };
14715
+ TieredMenuDirective.prototype._createNestedMenu = function () {
14716
+ if (!this._componentRef && this.items) {
14717
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuNestedComponent);
14718
+ this._componentRef = componentFactory.create(this._injector);
14719
+ this._appRef.attachView(this._componentRef.hostView);
14720
+ var domElem = this._componentRef.hostView.rootNodes[0];
14721
+ document.body.appendChild(domElem);
14722
+ this._setMenuComponentProperties();
14723
+ this._menuDivElement = domElem.querySelector(".menu");
14724
+ this._setMenuPosition();
14725
+ }
14726
+ };
14727
+ TieredMenuDirective.prototype._destroy = function () {
14728
+ var _a;
14729
+ if (this._componentRef !== null && !this.alwaysOpen) {
14730
+ this._isOpen = false;
14731
+ window.clearTimeout(this._showTimeout);
14732
+ this._appRef.detachView(this._componentRef.hostView);
14733
+ this._componentRef.destroy();
14734
+ this._componentRef = null;
14735
+ this._menuDivElement = null;
14736
+ (_a = this._lastActiveElement) === null || _a === void 0 ? void 0 : _a.focus();
14737
+ this._tieredMenuService.currentItems = this._tieredMenuService.items;
14738
+ this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
14739
+ }
14740
+ };
14741
+ TieredMenuDirective.prototype._setMenuPosition = function () {
14742
+ if (this._componentRef !== null) {
14743
+ var _a = this._elementRef.nativeElement.getBoundingClientRect(), right = _a.right, bottom = _a.bottom, left = _a.left;
14744
+ var menuWidth = this._menuDivElement.getBoundingClientRect().width;
14745
+ var rightFreeSpace = document.body.clientWidth - right;
14746
+ var topPosition = bottom + 2;
14747
+ this._componentRef.instance.top = topPosition;
14748
+ if (!this._isNested) {
14749
+ if (rightFreeSpace > menuWidth) {
14750
+ this._componentRef.instance.left = left;
14751
+ }
14752
+ else {
14753
+ this._componentRef.instance.left = left - menuWidth;
14754
+ }
14755
+ }
14756
+ else {
14757
+ // setting the maximum menu size to ensure its content is always visible. 10px margin.
14758
+ this._componentRef.instance.maxHeight = window.innerHeight - topPosition - 10;
14759
+ }
14760
+ }
14761
+ };
14762
+ TieredMenuDirective.prototype._setMenuComponentProperties = function () {
14763
+ if (this._componentRef != null) {
14764
+ this._componentRef.instance.items = this.items;
14765
+ }
14766
+ };
14767
+ TieredMenuDirective.prototype._subscribeEvents = function () {
14768
+ var _this = this;
14769
+ this._tieredMenuEventService.closeAllMenusEvent
14770
+ .pipe(takeUntil(this._unsubscribe$))
14771
+ .subscribe(function () {
14772
+ _this.items = _this._tieredMenuService.markAllItemsAsClosed(_this.items);
14773
+ _this._destroy();
14774
+ });
14775
+ };
14776
+ TieredMenuDirective.ctorParameters = function () { return [
14777
+ { type: ElementRef },
14778
+ { type: ApplicationRef },
14779
+ { type: ComponentFactoryResolver },
14780
+ { type: Injector },
14781
+ { type: TieredMenuEventService },
14782
+ { type: TieredMenuService }
14783
+ ]; };
14784
+ __decorate([
14785
+ Input()
14786
+ ], TieredMenuDirective.prototype, "items", void 0);
14787
+ __decorate([
14788
+ Input()
14789
+ ], TieredMenuDirective.prototype, "alwaysOpen", void 0);
14790
+ __decorate([
14791
+ Input()
14792
+ ], TieredMenuDirective.prototype, "triggerEvent", void 0);
14793
+ __decorate([
14794
+ HostListener("window:resize")
14795
+ ], TieredMenuDirective.prototype, "onResize", null);
14796
+ __decorate([
14797
+ HostListener("document:keydown", ["$event"])
14798
+ ], TieredMenuDirective.prototype, "onKeydownHandler", null);
14799
+ __decorate([
14800
+ HostListener("click", ["$event"])
14801
+ ], TieredMenuDirective.prototype, "onClick", null);
14802
+ __decorate([
14803
+ HostListener("document:click", ["$event"])
14804
+ ], TieredMenuDirective.prototype, "onDocumentClick", null);
14805
+ TieredMenuDirective = __decorate([
14806
+ Directive({
14807
+ selector: "[sTieredMenu]",
14808
+ })
14809
+ ], TieredMenuDirective);
14810
+ return TieredMenuDirective;
14811
+ }());
14812
+
14813
+ var TieredMenuItemComponent = /** @class */ (function () {
14814
+ function TieredMenuItemComponent(_tieredMenuEventService) {
14815
+ this._tieredMenuEventService = _tieredMenuEventService;
14816
+ this.focused = false;
14817
+ this.triggerEvent = "click";
14818
+ this.closeOnClick = false;
14819
+ }
14820
+ TieredMenuItemComponent.prototype.onClick = function () {
14821
+ if (this.item.submenu) {
14822
+ if (!this.item.isOpen) {
14823
+ this._tieredMenuEventService.emitOpenItemMenuEvent(this.item);
14824
+ }
14825
+ else if (this.closeOnClick) {
14826
+ this._tieredMenuEventService.emitCloseItemMenuEvent(this.item);
14827
+ }
14828
+ }
14829
+ else {
14830
+ this._tieredMenuEventService.emitSelectItemEvent(this.item);
14831
+ }
14832
+ };
14833
+ TieredMenuItemComponent.prototype.onMouseEnter = function () {
14834
+ var _this = this;
14835
+ if (this.triggerEvent === "hover" && !this.item.isOpen) {
14836
+ this._showTimeout = window.setTimeout(function () {
14837
+ _this._tieredMenuEventService.emitOpenItemMenuEvent(_this.item);
14838
+ }, 300);
14839
+ }
14840
+ };
14841
+ TieredMenuItemComponent.prototype.onMouseLeave = function () {
14842
+ window.clearTimeout(this._showTimeout);
14843
+ };
14844
+ TieredMenuItemComponent.ctorParameters = function () { return [
14845
+ { type: TieredMenuEventService }
14846
+ ]; };
14847
+ __decorate([
14848
+ Input()
14849
+ ], TieredMenuItemComponent.prototype, "item", void 0);
14850
+ __decorate([
14851
+ Input()
14852
+ ], TieredMenuItemComponent.prototype, "focused", void 0);
14853
+ __decorate([
14854
+ Input()
14855
+ ], TieredMenuItemComponent.prototype, "triggerEvent", void 0);
14856
+ __decorate([
14857
+ Input()
14858
+ ], TieredMenuItemComponent.prototype, "closeOnClick", void 0);
14859
+ __decorate([
14860
+ HostListener("click"),
14861
+ HostListener("touchend")
14862
+ ], TieredMenuItemComponent.prototype, "onClick", null);
14863
+ __decorate([
14864
+ HostListener("mouseenter")
14865
+ ], TieredMenuItemComponent.prototype, "onMouseEnter", null);
14866
+ __decorate([
14867
+ HostListener("mouseleave")
14868
+ ], TieredMenuItemComponent.prototype, "onMouseLeave", null);
14869
+ TieredMenuItemComponent = __decorate([
14870
+ Component({
14871
+ selector: "s-tiered-menu-item",
14872
+ 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>",
14873
+ 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}"]
14874
+ })
14875
+ ], TieredMenuItemComponent);
14876
+ return TieredMenuItemComponent;
14877
+ }());
14878
+
14879
+ var TieredMenuDividerComponent = /** @class */ (function () {
14880
+ function TieredMenuDividerComponent() {
14881
+ }
14882
+ TieredMenuDividerComponent = __decorate([
14883
+ Component({
14884
+ selector: "s-tiered-menu-divider",
14885
+ template: "<div class=\"divider\"></div>",
14886
+ styles: [".divider{margin:2px 0;height:1px;background-color:#ccc}"]
14887
+ })
14888
+ ], TieredMenuDividerComponent);
14889
+ return TieredMenuDividerComponent;
14890
+ }());
14891
+
14892
+ var TieredMenuModule = /** @class */ (function () {
14893
+ function TieredMenuModule() {
14894
+ }
14895
+ TieredMenuModule = __decorate([
14896
+ NgModule({
14897
+ imports: [
14898
+ CommonModule,
14899
+ BrowserModule,
14900
+ ],
14901
+ declarations: [
14902
+ TieredMenuDirective,
14903
+ TieredMenuComponent,
14904
+ TieredMenuNestedComponent,
14905
+ TieredMenuItemComponent,
14906
+ TieredMenuDividerComponent,
14907
+ ],
14908
+ exports: [TieredMenuDirective],
14909
+ providers: [
14910
+ TieredMenuEventService,
14911
+ TieredMenuService,
14912
+ ],
14913
+ })
14914
+ ], TieredMenuModule);
14915
+ return TieredMenuModule;
14916
+ }());
14917
+
14162
14918
  var WorkspaceSwitchComponent = /** @class */ (function () {
14163
14919
  function WorkspaceSwitchComponent(eRef) {
14164
14920
  this.eRef = eRef;
@@ -14802,5 +15558,5 @@ var fallback = {
14802
15558
  * Generated bundle index. Do not edit.
14803
15559
  */
14804
15560
 
14805
- export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, SelectFieldComponent as ɵba, TextAreaFieldComponent as ɵbb, TextFieldComponent as ɵbc, BooleanSwitchFieldComponent as ɵbd, PasswordFieldComponent as ɵbe, SliderFieldComponent as ɵbf, DecimalField as ɵbh, SideTableComponent as ɵbi, StructureModule as ɵbj, HeaderComponent as ɵbk, FooterComponent as ɵbl, NumberLocaleOptions as ɵbm, ThumbnailService as ɵbn, BorderButtonModule as ɵbo, BorderButtonComponent as ɵbp, TimelineItemModule as ɵbq, TimelineIconItemComponent as ɵbr, HorizontalTimelineModule as ɵbs, HorizontalTimelineComponent as ɵbt, VerticalTimelineModule as ɵbu, VerticalTimelineComponent as ɵbv, RangeLineComponent as ɵbw, CollapseOptionComponent as ɵbx, CollapsedItemsComponent as ɵby, VerticalItemsComponent as ɵbz, CountryPhonePickerService as ɵc, InfiniteScrollModule as ɵca, InfiniteScrollDirective as ɵcb, CustomTranslationsModule as ɵcc, CodeEditorComponent as ɵcd, CoreFacade as ɵce, CodeMirror6Core as ɵcf, LocalizedCurrencyImpurePipe as ɵd, LocalizedBignumberPipe as ɵe, LocalizedBignumberImpurePipe as ɵf, EmptyStateGoBackComponent as ɵg, FileUploadService as ɵh, InfoSignComponent as ɵi, TableColumnsComponent as ɵj, TablePagingComponent as ɵk, AutocompleteFieldComponent as ɵl, BooleanFieldComponent as ɵm, CalendarFieldComponent as ɵn, ChipsFieldComponent as ɵo, CurrencyFieldComponent as ɵp, DynamicFieldComponent as ɵq, DynamicFormDirective as ɵr, FieldsetComponent as ɵs, FileUploadComponent$1 as ɵt, LookupFieldComponent as ɵu, NumberFieldComponent as ɵv, BignumberFieldComponent as ɵw, RadioButtonComponent as ɵx, RowComponent as ɵy, SectionComponent as ɵz };
15561
+ export { AccordionComponent, AccordionModule, AccordionPanelComponent, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CountryPhonePickerComponent, CountryPhonePickerModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DebounceUtils, DoubleClickDirective, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, EnumSeverity, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, Ordination, PanelComponent, PanelModule, PasswordField, PasswordStrengthComponent, PasswordStrengthDirective, PasswordStrengthModule, PasswordStrengthPositions, PasswordStrengths, ProductHeaderComponent, ProductHeaderModule, ProfilePicturePickerComponent, ProfilePicturePickerModule, ProgressBarColors, ProgressBarComponent, ProgressBarModule, RadioButtonField, RatingScaleComponent, RatingScaleModule, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, SlidePanelComponent, SlidePanelModule, SplitButtonComponent, SplitButtonModule, SplitButtonType, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, SwitchComponent, SwitchModule, TableFrozenPositionDirective, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TieredMenuDirective, TieredMenuModule, TileComponent, TileModule, TimelineComponent, TimelineItem, TimelineItemSeverity, TimelineItemSize, TimelineModule, TokenListComponent, TokenListModule, TooltipModule, TooltipPosition, ValidateErrors, ViewMode, WorkspaceSwitchComponent, WorkspaceSwitchModule, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, SelectFieldComponent as ɵba, TextAreaFieldComponent as ɵbb, TextFieldComponent as ɵbc, BooleanSwitchFieldComponent as ɵbd, PasswordFieldComponent as ɵbe, SliderFieldComponent as ɵbf, DecimalField as ɵbh, SideTableComponent as ɵbi, StructureModule as ɵbj, HeaderComponent as ɵbk, FooterComponent as ɵbl, NumberLocaleOptions as ɵbm, ThumbnailService as ɵbn, BorderButtonModule as ɵbo, BorderButtonComponent as ɵbp, TimelineItemModule as ɵbq, TimelineIconItemComponent as ɵbr, HorizontalTimelineModule as ɵbs, HorizontalTimelineComponent as ɵbt, VerticalTimelineModule as ɵbu, VerticalTimelineComponent as ɵbv, RangeLineComponent as ɵbw, CollapseOptionComponent as ɵbx, CollapsedItemsComponent as ɵby, VerticalItemsComponent as ɵbz, CountryPhonePickerService as ɵc, InfiniteScrollModule as ɵca, InfiniteScrollDirective as ɵcb, CustomTranslationsModule as ɵcc, CodeEditorComponent as ɵcd, CoreFacade as ɵce, CodeMirror6Core as ɵcf, TieredMenuEventService as ɵcg, TieredMenuService as ɵch, TieredMenuComponent as ɵci, TieredMenuNestedComponent as ɵcj, TieredMenuItemComponent as ɵck, TieredMenuDividerComponent as ɵcl, LocalizedCurrencyImpurePipe as ɵd, LocalizedBignumberPipe as ɵe, LocalizedBignumberImpurePipe as ɵf, EmptyStateGoBackComponent as ɵg, FileUploadService as ɵh, InfoSignComponent as ɵi, TableColumnsComponent as ɵj, TablePagingComponent as ɵk, AutocompleteFieldComponent as ɵl, BooleanFieldComponent as ɵm, CalendarFieldComponent as ɵn, ChipsFieldComponent as ɵo, CurrencyFieldComponent as ɵp, DynamicFieldComponent as ɵq, DynamicFormDirective as ɵr, FieldsetComponent as ɵs, FileUploadComponent$1 as ɵt, LookupFieldComponent as ɵu, NumberFieldComponent as ɵv, BignumberFieldComponent as ɵw, RadioButtonComponent as ɵx, RowComponent as ɵy, SectionComponent as ɵz };
14806
15562
  //# sourceMappingURL=seniorsistemas-angular-components.js.map