@seniorsistemas/angular-components 17.8.10 → 17.8.12

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 (34) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +2105 -1974
  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 +2 -0
  6. package/components/file-upload/models/validate-errors.d.ts +1 -0
  7. package/components/index.d.ts +1 -0
  8. package/components/navigation-button/index.d.ts +3 -0
  9. package/components/navigation-button/models/navigation-button-item.d.ts +5 -0
  10. package/components/navigation-button/navigation-button.component.d.ts +27 -0
  11. package/components/navigation-button/navigation-button.module.d.ts +2 -0
  12. package/esm2015/components/file-upload/file-upload.component.js +20 -1
  13. package/esm2015/components/file-upload/models/validate-errors.js +2 -1
  14. package/esm2015/components/index.js +2 -1
  15. package/esm2015/components/navigation-button/index.js +3 -0
  16. package/esm2015/components/navigation-button/models/navigation-button-item.js +1 -0
  17. package/esm2015/components/navigation-button/navigation-button.component.js +95 -0
  18. package/esm2015/components/navigation-button/navigation-button.module.js +17 -0
  19. package/esm2015/seniorsistemas-angular-components.js +14 -14
  20. package/esm5/components/file-upload/file-upload.component.js +21 -2
  21. package/esm5/components/file-upload/models/validate-errors.js +2 -1
  22. package/esm5/components/index.js +2 -1
  23. package/esm5/components/navigation-button/index.js +3 -0
  24. package/esm5/components/navigation-button/models/navigation-button-item.js +1 -0
  25. package/esm5/components/navigation-button/navigation-button.component.js +100 -0
  26. package/esm5/components/navigation-button/navigation-button.module.js +20 -0
  27. package/esm5/seniorsistemas-angular-components.js +14 -14
  28. package/fesm2015/seniorsistemas-angular-components.js +1954 -1833
  29. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  30. package/fesm5/seniorsistemas-angular-components.js +2084 -1955
  31. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  32. package/package.json +1 -1
  33. package/seniorsistemas-angular-components.d.ts +13 -13
  34. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -5858,6 +5858,7 @@ var ValidateErrors;
5858
5858
  (function (ValidateErrors) {
5859
5859
  ValidateErrors["MAX_FILE_SIZE"] = "MAX_FILE_SIZE";
5860
5860
  ValidateErrors["MAX_FILE_LIMIT"] = "MAX_FILE_LIMIT";
5861
+ ValidateErrors["MAX_COMBINED_FILE_SIZE"] = "MAX_COMBINED_FILE_SIZE";
5861
5862
  ValidateErrors["UNSUPPORTED_EXTENSION"] = "UNSUPPORTED_EXTENSION";
5862
5863
  })(ValidateErrors || (ValidateErrors = {}));
5863
5864
 
@@ -5936,6 +5937,14 @@ let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
5936
5937
  this.clearFileInput();
5937
5938
  return;
5938
5939
  }
5940
+ if (this.isFileCombinedSizeExceeded(files)) {
5941
+ this.validateErrors.emit({
5942
+ files: files,
5943
+ validation: ValidateErrors.MAX_COMBINED_FILE_SIZE,
5944
+ });
5945
+ this.clearFileInput();
5946
+ return;
5947
+ }
5939
5948
  for (const file of files) {
5940
5949
  if (this.isUnsupportedFileExtension(file)) {
5941
5950
  this.validateErrors.emit({
@@ -5997,6 +6006,14 @@ let FileUploadComponent = FileUploadComponent_1 = class FileUploadComponent {
5997
6006
  }
5998
6007
  return this.files.length + files.length > this.fileLimit;
5999
6008
  }
6009
+ isFileCombinedSizeExceeded(files) {
6010
+ if (!this.maxCombinedFileSize) {
6011
+ return false;
6012
+ }
6013
+ const filesList = [...files, ...this.files];
6014
+ const combinedSize = filesList.reduce((combinedSize, file) => combinedSize + file.size, 0);
6015
+ return combinedSize > this.maxCombinedFileSize;
6016
+ }
6000
6017
  isFileSizeExceeded(file) {
6001
6018
  if (!this.maxFileSize) {
6002
6019
  return false;
@@ -6072,6 +6089,9 @@ __decorate([
6072
6089
  __decorate([
6073
6090
  Input()
6074
6091
  ], FileUploadComponent.prototype, "maxFileSize", void 0);
6092
+ __decorate([
6093
+ Input()
6094
+ ], FileUploadComponent.prototype, "maxCombinedFileSize", void 0);
6075
6095
  __decorate([
6076
6096
  Input()
6077
6097
  ], FileUploadComponent.prototype, "fileLimit", void 0);
@@ -13786,2192 +13806,2293 @@ KanbanModule = __decorate([
13786
13806
  })
13787
13807
  ], KanbanModule);
13788
13808
 
13789
- var ObjectCardFieldComponent_1;
13790
- let ObjectCardFieldComponent = ObjectCardFieldComponent_1 = class ObjectCardFieldComponent {
13809
+ var NavigationButtonComponent_1;
13810
+ let NavigationButtonComponent = NavigationButtonComponent_1 = class NavigationButtonComponent {
13791
13811
  constructor() {
13792
- this.id = `s-object-card-field-${ObjectCardFieldComponent_1.nextId++}`;
13793
- this.buttonClick = new EventEmitter();
13812
+ this.stepChanged = new EventEmitter();
13813
+ this.currentIndex = 0;
13814
+ this.isDisabled = false;
13815
+ this.tieredMenuItems = [];
13816
+ }
13817
+ ngOnInit() {
13818
+ const index = this.steps.findIndex((step) => step.value === this._value);
13819
+ this.currentIndex = index !== -1 ? index : 0;
13820
+ this.stepChanged.emit({
13821
+ previous: undefined,
13822
+ current: this.steps[this.currentIndex],
13823
+ });
13824
+ this._createTieredMenuItems();
13825
+ }
13826
+ writeValue(value) {
13827
+ this._value = value;
13828
+ const index = this.steps.findIndex((step) => step.value === this._value);
13829
+ this.currentIndex = index !== -1 ? index : 0;
13830
+ }
13831
+ registerOnChange(onChange) {
13832
+ this._onChange = onChange;
13833
+ }
13834
+ registerOnTouched(onTouched) {
13835
+ this._onTouched = onTouched;
13836
+ }
13837
+ setDisabledState(isDisabled) {
13838
+ this.isDisabled = isDisabled;
13839
+ }
13840
+ onNext() {
13841
+ if (this.isDisabled)
13842
+ return;
13843
+ const previous = this.steps[this.currentIndex];
13844
+ if (this.currentIndex < this.steps.length - 1) {
13845
+ this.currentIndex++;
13846
+ }
13847
+ const current = this.steps[this.currentIndex];
13848
+ this._onTouched && this._onTouched();
13849
+ this._onChange && this._onChange(current.value);
13850
+ this.stepChanged.emit({ previous, current });
13851
+ }
13852
+ onPrevious() {
13853
+ if (this.isDisabled)
13854
+ return;
13855
+ const previous = this.steps[this.currentIndex];
13856
+ if (this.currentIndex > 0) {
13857
+ this.currentIndex--;
13858
+ }
13859
+ const current = this.steps[this.currentIndex];
13860
+ this._onTouched && this._onTouched();
13861
+ this._onChange && this._onChange(current.value);
13862
+ this.stepChanged.emit({ previous, current });
13863
+ }
13864
+ _createTieredMenuItems() {
13865
+ this.steps.forEach((step) => {
13866
+ this.tieredMenuItems.push({
13867
+ label: step.label,
13868
+ command: () => this.currentIndex = this.steps.findIndex(s => s === step),
13869
+ });
13870
+ });
13794
13871
  }
13795
13872
  };
13796
- ObjectCardFieldComponent.nextId = 0;
13797
- __decorate([
13798
- Input()
13799
- ], ObjectCardFieldComponent.prototype, "id", void 0);
13800
- __decorate([
13801
- Input()
13802
- ], ObjectCardFieldComponent.prototype, "imageSource", void 0);
13803
- __decorate([
13804
- Input()
13805
- ], ObjectCardFieldComponent.prototype, "imageAlt", void 0);
13806
- __decorate([
13807
- Input()
13808
- ], ObjectCardFieldComponent.prototype, "iconClass", void 0);
13809
13873
  __decorate([
13810
13874
  Input()
13811
- ], ObjectCardFieldComponent.prototype, "label", void 0);
13812
- __decorate([
13813
- Input()
13814
- ], ObjectCardFieldComponent.prototype, "description", void 0);
13875
+ ], NavigationButtonComponent.prototype, "steps", void 0);
13815
13876
  __decorate([
13816
13877
  Input()
13817
- ], ObjectCardFieldComponent.prototype, "buttonLabel", void 0);
13878
+ ], NavigationButtonComponent.prototype, "defaultValue", void 0);
13818
13879
  __decorate([
13819
13880
  Input()
13820
- ], ObjectCardFieldComponent.prototype, "buttonModel", void 0);
13881
+ ], NavigationButtonComponent.prototype, "tooltip", void 0);
13821
13882
  __decorate([
13822
13883
  Output()
13823
- ], ObjectCardFieldComponent.prototype, "buttonClick", void 0);
13824
- __decorate([
13825
- ContentChild(ThumbnailComponent, { static: true })
13826
- ], ObjectCardFieldComponent.prototype, "thumbnailComponent", void 0);
13827
- __decorate([
13828
- ViewChild(TemplateRef, { static: true })
13829
- ], ObjectCardFieldComponent.prototype, "content", void 0);
13830
- ObjectCardFieldComponent = ObjectCardFieldComponent_1 = __decorate([
13884
+ ], NavigationButtonComponent.prototype, "stepChanged", void 0);
13885
+ NavigationButtonComponent = NavigationButtonComponent_1 = __decorate([
13831
13886
  Component({
13832
- selector: "s-object-card-field",
13833
- template: "<ng-template>\n <div class=\"container\">\n <ng-content select=\"s-thumbnail\"></ng-content>\n <s-thumbnail\n [id]=\"id + '-thumbnail'\"\n *ngIf=\"!thumbnailComponent && (imageSource || iconClass)\"\n [imageSource]=\"imageSource\"\n [imageAlt]=\"imageAlt || label\"\n [iconClass]=\"iconClass\"\n size=\"small\"\n ></s-thumbnail>\n\n <div class=\"info-container\">\n <div #labelTemplate><ng-content select=\"[labelTemplate]\"></ng-content></div>\n <span\n [id]=\"id + '-label'\"\n *ngIf=\"!labelTemplate.children.length\"\n class=\"label\"\n [pTooltip]=\"label\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ label }}</span\n >\n\n <div #descriptionTemplate><ng-content select=\"[descriptionTemplate]\"></ng-content></div>\n <span\n [id]=\"id + '-description'\"\n *ngIf=\"!descriptionTemplate.children.length\"\n class=\"description\"\n [pTooltip]=\"description\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ description }}</span\n >\n\n <s-button\n [id]=\"id + '-button'\"\n *ngIf=\"buttonLabel\"\n styleClass=\"object-card-button\"\n priority=\"link\"\n [label]=\"buttonLabel\"\n [model]=\"buttonModel\"\n size=\"small\"\n (onClick)=\"buttonClick.emit($event)\"\n ></s-button>\n </div>\n </div>\n</ng-template>\n",
13834
- styles: [".container{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;height:100%}.info-container{margin-left:10px}.info-container,.info-container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.info-container .label{color:#999;display:block}.info-container .description{display:block}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.info-container{-ms-flex:1;flex:1}}@media (max-width:767px){.info-container,.info-container span{white-space:normal}}.info-container:only-child{margin-left:0}"]
13887
+ selector: "s-navigation-button",
13888
+ template: "<div class=\"navigation-button\" [ngClass]=\"{ 'navigation-button--disabled': isDisabled}\">\n <button\n class=\"option option--previous\"\n [ngClass]=\"{ 'option--disabled': currentIndex === 0 }\"\n (click)=\"onPrevious()\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n\n <ng-container *ngIf=\"steps[currentIndex].tooltip || tooltip; then tooltipBlock; else noTooltipBlock\"></ng-container>\n\n <ng-template #tooltipBlock>\n <button\n [sTooltip]=\"steps[currentIndex].tooltip || tooltip\"\n class=\"step\"\n sTieredMenu [items]=\"tieredMenuItems\">\n {{ steps[currentIndex].label }}\n </button>\n </ng-template>\n\n <ng-template #noTooltipBlock>\n <button class=\"step\">\n {{ steps[currentIndex].label }}\n </button>\n </ng-template>\n\n <button\n class=\"option option--next\"\n [ngClass]=\"{ 'option--disabled': currentIndex === steps.length - 1 }\"\n (click)=\"onNext()\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n</div>\n",
13889
+ providers: [
13890
+ {
13891
+ provide: NG_VALUE_ACCESSOR,
13892
+ useExisting: forwardRef(() => NavigationButtonComponent_1),
13893
+ multi: true,
13894
+ },
13895
+ ],
13896
+ styles: [".navigation-button{display:-ms-inline-flexbox;display:inline-flex}.navigation-button .option,.navigation-button .step{background-color:#428bca;border:none;color:#fff}.navigation-button:not(.navigation-button--disabled) .step{cursor:pointer}.navigation-button:not(.navigation-button--disabled) .step:hover{background-color:#063951}.navigation-button .option{padding:8px 12px}.navigation-button .option--previous{border-radius:16px 0 0 16px}.navigation-button .option--next{border-radius:0 16px 16px 0}.navigation-button .option--disabled{opacity:.5}.navigation-button .option:not(.option--disabled):hover{cursor:pointer;background-color:#063951}.navigation-button .step{font-family:\"Open Sans\",sans-serif;font-size:14px;padding:8px 16px;text-align:center}.navigation-button--disabled{opacity:.5}"]
13835
13897
  })
13836
- ], ObjectCardFieldComponent);
13898
+ ], NavigationButtonComponent);
13837
13899
 
13838
- var ObjectCardMainComponent_1;
13839
- let ObjectCardMainComponent = ObjectCardMainComponent_1 = class ObjectCardMainComponent {
13900
+ let TieredMenuDividerComponent = class TieredMenuDividerComponent {
13901
+ };
13902
+ TieredMenuDividerComponent = __decorate([
13903
+ Component({
13904
+ selector: "s-tiered-menu-divider",
13905
+ template: "<div class=\"divider\"></div>",
13906
+ styles: [".divider{margin:2px 0;height:1px;background-color:#ccc}"]
13907
+ })
13908
+ ], TieredMenuDividerComponent);
13909
+
13910
+ let TieredMenuEventService = class TieredMenuEventService {
13840
13911
  constructor() {
13841
- this.id = `s-object-card-main-${ObjectCardMainComponent_1.nextId++}`;
13842
- this.iconClass = "fa fa-picture-o";
13843
- this.hasThumbnail = true;
13844
- this.hasDescription = true;
13845
- this.isBrand = false;
13846
- this.buttonClick = new EventEmitter();
13847
- this._thumbnailSize = ThumbnailSize.Medium;
13848
- }
13849
- set thumbnailSize(value) {
13850
- this._thumbnailSize = value;
13851
- if (this.thumbnailComponent)
13852
- this.thumbnailComponent.size = value;
13912
+ this.incrementCurrentItemEvent = new EventEmitter();
13913
+ this.decrementCurrentItemEvent = new EventEmitter();
13914
+ this.closeAllMenusEvent = new EventEmitter();
13915
+ this.selectItemEvent = new EventEmitter();
13916
+ this.openItemMenuEvent = new EventEmitter();
13917
+ this.closeItemMenuEvent = new EventEmitter();
13918
+ this.createMenuEvent = new EventEmitter();
13853
13919
  }
13854
- get thumbnailSize() {
13855
- return this._thumbnailSize;
13920
+ };
13921
+ TieredMenuEventService = __decorate([
13922
+ Injectable()
13923
+ ], TieredMenuEventService);
13924
+
13925
+ let TieredMenuItemComponent = class TieredMenuItemComponent {
13926
+ constructor(_tieredMenuEventService) {
13927
+ this._tieredMenuEventService = _tieredMenuEventService;
13928
+ this.focused = false;
13929
+ this.highlight = false;
13930
+ this.triggerEvent = "click";
13931
+ this.closeOnClick = false;
13856
13932
  }
13857
- onResize() {
13858
- this.update();
13933
+ onClick() {
13934
+ if (this.item.disabled)
13935
+ return;
13936
+ if (this.item.submenu) {
13937
+ if (!this.item.isOpen) {
13938
+ this._tieredMenuEventService.openItemMenuEvent.emit(this.item);
13939
+ }
13940
+ else if (this.closeOnClick) {
13941
+ this._tieredMenuEventService.closeItemMenuEvent.emit(this.item);
13942
+ }
13943
+ }
13944
+ else {
13945
+ this._tieredMenuEventService.selectItemEvent.emit(this.item);
13946
+ }
13859
13947
  }
13860
- ngAfterContentInit() {
13861
- this.update();
13948
+ onMouseEnter() {
13949
+ if (this.item.disabled)
13950
+ return;
13951
+ if (this.triggerEvent === "hover" && !this.item.isOpen) {
13952
+ this._showTimeout = window.setTimeout(() => {
13953
+ this._tieredMenuEventService.openItemMenuEvent.emit(this.item);
13954
+ }, 300);
13955
+ }
13862
13956
  }
13863
- update() {
13864
- const windowWidth = window.innerWidth;
13865
- if (windowWidth <= Breakpoints.SM_MAX)
13866
- this.thumbnailSize = ThumbnailSize.Small;
13867
- else
13868
- this.thumbnailSize = ThumbnailSize.Medium;
13957
+ onMouseLeave() {
13958
+ window.clearTimeout(this._showTimeout);
13869
13959
  }
13870
13960
  };
13871
- ObjectCardMainComponent.nextId = 0;
13872
- __decorate([
13873
- Input()
13874
- ], ObjectCardMainComponent.prototype, "id", void 0);
13875
- __decorate([
13876
- Input()
13877
- ], ObjectCardMainComponent.prototype, "imageSource", void 0);
13878
- __decorate([
13879
- Input()
13880
- ], ObjectCardMainComponent.prototype, "imageFallback", void 0);
13881
- __decorate([
13882
- Input()
13883
- ], ObjectCardMainComponent.prototype, "imageAlt", void 0);
13884
- __decorate([
13885
- Input()
13886
- ], ObjectCardMainComponent.prototype, "iconClass", void 0);
13887
- __decorate([
13888
- Input()
13889
- ], ObjectCardMainComponent.prototype, "hasThumbnail", void 0);
13890
- __decorate([
13891
- Input()
13892
- ], ObjectCardMainComponent.prototype, "hasDescription", void 0);
13961
+ TieredMenuItemComponent.ctorParameters = () => [
13962
+ { type: TieredMenuEventService }
13963
+ ];
13893
13964
  __decorate([
13894
13965
  Input()
13895
- ], ObjectCardMainComponent.prototype, "isBrand", void 0);
13966
+ ], TieredMenuItemComponent.prototype, "item", void 0);
13896
13967
  __decorate([
13897
13968
  Input()
13898
- ], ObjectCardMainComponent.prototype, "label", void 0);
13969
+ ], TieredMenuItemComponent.prototype, "focused", void 0);
13899
13970
  __decorate([
13900
13971
  Input()
13901
- ], ObjectCardMainComponent.prototype, "description", void 0);
13972
+ ], TieredMenuItemComponent.prototype, "highlight", void 0);
13902
13973
  __decorate([
13903
13974
  Input()
13904
- ], ObjectCardMainComponent.prototype, "buttonLabel", void 0);
13975
+ ], TieredMenuItemComponent.prototype, "triggerEvent", void 0);
13905
13976
  __decorate([
13906
13977
  Input()
13907
- ], ObjectCardMainComponent.prototype, "buttonModel", void 0);
13978
+ ], TieredMenuItemComponent.prototype, "closeOnClick", void 0);
13908
13979
  __decorate([
13909
- Output()
13910
- ], ObjectCardMainComponent.prototype, "buttonClick", void 0);
13980
+ HostListener("click"),
13981
+ HostListener("touchend")
13982
+ ], TieredMenuItemComponent.prototype, "onClick", null);
13911
13983
  __decorate([
13912
- ContentChild(ThumbnailComponent, { static: true })
13913
- ], ObjectCardMainComponent.prototype, "thumbnailComponent", void 0);
13984
+ HostListener("mouseenter")
13985
+ ], TieredMenuItemComponent.prototype, "onMouseEnter", null);
13914
13986
  __decorate([
13915
- HostListener("window:resize")
13916
- ], ObjectCardMainComponent.prototype, "onResize", null);
13917
- ObjectCardMainComponent = ObjectCardMainComponent_1 = __decorate([
13987
+ HostListener("mouseleave")
13988
+ ], TieredMenuItemComponent.prototype, "onMouseLeave", null);
13989
+ TieredMenuItemComponent = __decorate([
13918
13990
  Component({
13919
- selector: "s-object-card-main",
13920
- template: "<ng-container *ngIf=\"hasThumbnail\">\n <ng-content select=\"s-thumbnail\"></ng-content>\n <s-thumbnail\n [id]=\"id + '-thumbnail'\"\n [imageSource]=\"imageSource\"\n [imageFallback]=\"imageFallback\"\n [imageAlt]=\"imageAlt || label\"\n [iconClass]=\"iconClass\"\n [size]=\"thumbnailSize\"\n *ngIf=\"!thumbnailComponent\"\n [isBrand]=\"isBrand\"\n ></s-thumbnail>\n</ng-container>\n\n<ng-container *ngIf=\"hasDescription\">\n <div class=\"info-container\">\n <div #labelTemplate><ng-content select=\"[labelTemplate]\"></ng-content></div>\n <span\n [id]=\"id + '-label'\"\n *ngIf=\"!labelTemplate.children.length\"\n class=\"label\"\n [pTooltip]=\"label\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ label }}</span\n >\n\n <div #descriptionTemplate><ng-content select=\"[descriptionTemplate]\"></ng-content></div>\n <span\n [id]=\"id + '-description'\"\n *ngIf=\"!descriptionTemplate.children.length\"\n class=\"description\"\n [pTooltip]=\"description\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ description }}</span\n >\n <s-button\n [id]=\"id + '-button'\"\n *ngIf=\"buttonLabel\"\n styleClass=\"object-card-button\"\n priority=\"link\"\n [label]=\"buttonLabel\"\n [model]=\"buttonModel\"\n size=\"small\"\n (onClick)=\"buttonClick.emit($event)\"\n ></s-button>\n </div>\n</ng-container>\n",
13921
- styles: [":host{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;min-height:70px}.info-container{margin-left:10px;-ms-flex:1;flex:1}.info-container,.info-container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.info-container .label{display:block;font-weight:700}.info-container .description{color:#999;display:block}@media (max-width:767px){.info-container,.info-container span{white-space:normal}}"]
13991
+ selector: "s-tiered-menu-item",
13992
+ 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 'tiered-menu-item--disabled': item.disabled\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>",
13993
+ 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}.tiered-menu-item--disabled{opacity:50%;cursor:default}"]
13922
13994
  })
13923
- ], ObjectCardMainComponent);
13924
-
13925
- var EnumSeverity;
13926
- (function (EnumSeverity) {
13927
- EnumSeverity["Default"] = "Default";
13928
- EnumSeverity["Info"] = "Info";
13929
- EnumSeverity["Warn"] = "Warn";
13930
- EnumSeverity["Error"] = "Error";
13931
- EnumSeverity["Success"] = "Success";
13932
- })(EnumSeverity || (EnumSeverity = {}));
13995
+ ], TieredMenuItemComponent);
13933
13996
 
13934
- var ObjectCardComponent_1;
13935
- const elementResizeDetectorMaker = elementResizeDetectorMaker_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
13936
- let ObjectCardComponent = ObjectCardComponent_1 = class ObjectCardComponent {
13937
- constructor(cdr, elementRef) {
13938
- this.cdr = cdr;
13939
- this.elementRef = elementRef;
13940
- this.id = `s-object-card-${ObjectCardComponent_1.nextId++}`;
13941
- this.expanded = false;
13942
- this.expandTooltip = "Abrir painel";
13943
- this.collapseTooltip = "Fechar painel";
13944
- this.fieldsMinWidth = 200;
13945
- this.expandedChange = new EventEmitter();
13946
- this.maxVisibleFields = 0;
13947
- this.severity = EnumSeverity.Default;
13948
- this.EnumSeverity = EnumSeverity;
13997
+ let TieredMenuService = class TieredMenuService {
13998
+ constructor() {
13999
+ this.currentItems = [];
14000
+ this.items = [];
13949
14001
  }
13950
- ngAfterViewInit() {
13951
- this.update();
13952
- this.cdr.detectChanges();
13953
- this.fields.changes.subscribe(() => {
13954
- this.update();
13955
- });
13956
- const erd = elementResizeDetectorMaker({
13957
- strategy: "scroll",
14002
+ normalizeData(items, parent) {
14003
+ return items.map((i) => {
14004
+ const item = Object.assign({ visible: true }, i);
14005
+ if (item.submenu) {
14006
+ item.submenu = this.normalizeData(item.submenu, item);
14007
+ }
14008
+ item.id = this._generateId();
14009
+ item.parent = parent;
14010
+ item.isOpen = false;
14011
+ return item;
13958
14012
  });
13959
- erd.listenTo(this.elementRef.nativeElement, () => this.update());
13960
14013
  }
13961
- update() {
13962
- const windowWidth = window.innerWidth;
13963
- const containerWidth = this.elementRef.nativeElement.offsetWidth;
13964
- const mainFieldWidth = containerWidth * 0.3 > 260 ? containerWidth * 0.3 : 260;
13965
- const fieldsMinWidth = this.fieldsMinWidth;
13966
- const expandIconWidth = 50;
13967
- const fieldElementList = this.elementRef.nativeElement.getElementsByClassName("s-object-card-field");
13968
- for (const element of fieldElementList) {
13969
- element.style.minWidth = `${this.fieldsMinWidth}px`;
14014
+ markAllItemsAsClosed(items) {
14015
+ return items.map((i) => {
14016
+ const item = Object.assign({}, i);
14017
+ if (item.submenu) {
14018
+ item.submenu = this.markAllItemsAsClosed(item.submenu);
14019
+ }
14020
+ item.isOpen = false;
14021
+ return item;
14022
+ });
14023
+ }
14024
+ searchTheHierarchy(itemA, itemB) {
14025
+ let item = itemB;
14026
+ while (item) {
14027
+ if (item === itemA) {
14028
+ return true;
14029
+ }
14030
+ item = item.parent;
13970
14031
  }
13971
- let maxFieldQtd;
13972
- if (windowWidth <= Breakpoints.SM_MAX)
13973
- maxFieldQtd = 0;
13974
- else
13975
- maxFieldQtd = Math.floor((containerWidth - mainFieldWidth) / fieldsMinWidth);
13976
- if (maxFieldQtd && maxFieldQtd < this.fields.length) {
13977
- maxFieldQtd = Math.floor((containerWidth - mainFieldWidth - expandIconWidth) / fieldsMinWidth);
14032
+ return false;
14033
+ }
14034
+ cloneItems(items) {
14035
+ return JSON.parse(JSON.stringify(items));
14036
+ }
14037
+ _generateId() {
14038
+ return `id-${Math.random().toString(36).substring(2, 9)}-${Math.random().toString(36).substring(2, 9)}-${Math.random().toString(36).substring(2, 9)}`;
14039
+ }
14040
+ };
14041
+ TieredMenuService = __decorate([
14042
+ Injectable()
14043
+ ], TieredMenuService);
14044
+
14045
+ let TieredMenuNestedComponent = class TieredMenuNestedComponent {
14046
+ constructor(tieredMenuService, _tieredMenuEventService) {
14047
+ this.tieredMenuService = tieredMenuService;
14048
+ this._tieredMenuEventService = _tieredMenuEventService;
14049
+ this.top = 0;
14050
+ this.left = 0;
14051
+ this._unsubscribe$ = new Subject();
14052
+ }
14053
+ onResize() {
14054
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
14055
+ }
14056
+ onDocumentClick(event) {
14057
+ // Closing menu when clicked outside.
14058
+ const target = event.target;
14059
+ const clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
14060
+ if (!clickedInside) {
14061
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
13978
14062
  }
13979
- this.maxVisibleFields = maxFieldQtd;
13980
- if (maxFieldQtd >= this.fields.length && this.expanded)
13981
- this.collapse();
13982
14063
  }
13983
- toggle() {
13984
- this.expanded ? this.collapse() : this.expand();
14064
+ onKeydownHandler(event) {
14065
+ switch (event.key) {
14066
+ case "Escape":
14067
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
14068
+ break;
14069
+ case " ":
14070
+ case "Enter":
14071
+ this._tieredMenuEventService.selectItemEvent.emit(this.tieredMenuService.currentItem);
14072
+ break;
14073
+ case "ArrowLeft":
14074
+ // When nested I need a reference to the current item's parent item, otherwise just the current item.
14075
+ this._tieredMenuEventService.closeItemMenuEvent.emit(this.tieredMenuService.currentItem.parent);
14076
+ break;
14077
+ case "ArrowRight":
14078
+ this._tieredMenuEventService.openItemMenuEvent.emit(this.tieredMenuService.currentItem);
14079
+ break;
14080
+ case "ArrowUp":
14081
+ this._tieredMenuEventService.decrementCurrentItemEvent.emit();
14082
+ break;
14083
+ case "ArrowDown":
14084
+ this._tieredMenuEventService.incrementCurrentItemEvent.emit();
14085
+ break;
14086
+ }
13985
14087
  }
13986
- expand() {
13987
- this.expanded = true;
13988
- this.expandedChange.emit(this.expanded);
14088
+ ngOnInit() {
14089
+ this.tieredMenuService.currentItems = this.items;
14090
+ this._subscribeEvents();
13989
14091
  }
13990
- collapse() {
13991
- this.expanded = false;
13992
- this.expandedChange.emit(this.expanded);
14092
+ ngOnDestroy() {
14093
+ this._unsubscribe$.next();
14094
+ this._unsubscribe$.complete();
13993
14095
  }
13994
- getExpandedFieldWidth() {
13995
- const containerWidth = this.elementRef.nativeElement.offsetWidth;
13996
- let fieldsPerRow;
13997
- if (containerWidth <= Breakpoints.SM_MAX)
13998
- fieldsPerRow = 1;
13999
- else if (containerWidth <= Breakpoints.MD_MAX)
14000
- fieldsPerRow = 2;
14001
- else if (containerWidth <= Breakpoints.LG_MAX)
14002
- fieldsPerRow = 4;
14003
- else
14004
- fieldsPerRow = 6;
14005
- return 12 / fieldsPerRow;
14096
+ _incrementCurItem() {
14097
+ if (!this.tieredMenuService.currentItem) {
14098
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14099
+ return;
14100
+ }
14101
+ const curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
14102
+ if (curIndex < this.tieredMenuService.currentItems.length) {
14103
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14104
+ }
14105
+ else {
14106
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14107
+ }
14108
+ if (this.tieredMenuService.currentItem.divider) {
14109
+ this._incrementCurItem();
14110
+ }
14111
+ }
14112
+ _decrementCurItem() {
14113
+ if (!this.tieredMenuService.currentItem) {
14114
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14115
+ return;
14116
+ }
14117
+ const curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
14118
+ if (curIndex >= 0) {
14119
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14120
+ }
14121
+ else {
14122
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
14123
+ }
14124
+ if (this.tieredMenuService.currentItem.divider) {
14125
+ this._decrementCurItem();
14126
+ }
14127
+ }
14128
+ _closeItem(item) {
14129
+ var _a;
14130
+ let itemAux = this._lastOpenItem;
14131
+ while (itemAux && itemAux != item) {
14132
+ itemAux.isOpen = false;
14133
+ itemAux = itemAux.parent;
14134
+ }
14135
+ item.isOpen = false;
14136
+ this.tieredMenuService.currentItem = itemAux !== null && itemAux !== void 0 ? itemAux : this.tieredMenuService.items[0];
14137
+ this.tieredMenuService.currentItems = ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.submenu) || this.tieredMenuService.items;
14138
+ }
14139
+ _openItem(item) {
14140
+ if (item === null || item === void 0 ? void 0 : item.submenu) {
14141
+ item.isOpen = true;
14142
+ this.tieredMenuService.currentItems = item.submenu;
14143
+ // Only has focus if there has already been interaction.
14144
+ if (this.tieredMenuService.currentItem) {
14145
+ this.tieredMenuService.currentItem = item.submenu[0];
14146
+ }
14147
+ this._lastOpenItem = item;
14148
+ }
14149
+ }
14150
+ _subscribeEvents() {
14151
+ this._tieredMenuEventService.incrementCurrentItemEvent
14152
+ .pipe(takeUntil(this._unsubscribe$))
14153
+ .subscribe(() => {
14154
+ this._incrementCurItem();
14155
+ });
14156
+ this._tieredMenuEventService.decrementCurrentItemEvent
14157
+ .pipe(takeUntil(this._unsubscribe$))
14158
+ .subscribe(() => {
14159
+ this._decrementCurItem();
14160
+ });
14161
+ this._tieredMenuEventService.selectItemEvent
14162
+ .pipe(takeUntil(this._unsubscribe$))
14163
+ .subscribe((item) => {
14164
+ if (item.command) {
14165
+ item.command();
14166
+ // Close all menus after the item was selected.
14167
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
14168
+ }
14169
+ });
14170
+ this._tieredMenuEventService.openItemMenuEvent
14171
+ .pipe(takeUntil(this._unsubscribe$))
14172
+ .subscribe((item) => {
14173
+ var _a, _b;
14174
+ if (!this.tieredMenuService.currentItems.includes(item)) {
14175
+ let itemAux = this._lastOpenItem;
14176
+ while ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.parent) {
14177
+ itemAux = itemAux.parent;
14178
+ }
14179
+ this._tieredMenuEventService.closeItemMenuEvent.emit((_b = itemAux.parent) !== null && _b !== void 0 ? _b : itemAux);
14180
+ }
14181
+ this._lastOpenItem = item;
14182
+ this._openItem(item);
14183
+ });
14184
+ this._tieredMenuEventService.closeItemMenuEvent
14185
+ .pipe(takeUntil(this._unsubscribe$))
14186
+ .subscribe((item) => {
14187
+ if (item) {
14188
+ this._closeItem(item);
14189
+ }
14190
+ });
14006
14191
  }
14007
14192
  };
14008
- ObjectCardComponent.nextId = 0;
14009
- ObjectCardComponent.ctorParameters = () => [
14010
- { type: ChangeDetectorRef },
14011
- { type: ElementRef }
14193
+ TieredMenuNestedComponent.ctorParameters = () => [
14194
+ { type: TieredMenuService },
14195
+ { type: TieredMenuEventService }
14012
14196
  ];
14013
14197
  __decorate([
14014
- Input()
14015
- ], ObjectCardComponent.prototype, "id", void 0);
14016
- __decorate([
14017
- Input()
14018
- ], ObjectCardComponent.prototype, "expanded", void 0);
14019
- __decorate([
14020
- Input()
14021
- ], ObjectCardComponent.prototype, "expandTooltip", void 0);
14022
- __decorate([
14023
- Input()
14024
- ], ObjectCardComponent.prototype, "collapseTooltip", void 0);
14025
- __decorate([
14026
- Input()
14027
- ], ObjectCardComponent.prototype, "fieldsMinWidth", void 0);
14028
- __decorate([
14029
- Output()
14030
- ], ObjectCardComponent.prototype, "expandedChange", void 0);
14031
- __decorate([
14032
- ContentChild(ObjectCardMainComponent, { static: true })
14033
- ], ObjectCardComponent.prototype, "main", void 0);
14034
- __decorate([
14035
- ContentChildren(ObjectCardFieldComponent, { descendants: true })
14036
- ], ObjectCardComponent.prototype, "fields", void 0);
14198
+ HostListener("window:resize")
14199
+ ], TieredMenuNestedComponent.prototype, "onResize", null);
14037
14200
  __decorate([
14038
- Input()
14039
- ], ObjectCardComponent.prototype, "severity", void 0);
14201
+ HostListener("document:click", ["$event"])
14202
+ ], TieredMenuNestedComponent.prototype, "onDocumentClick", null);
14040
14203
  __decorate([
14041
- Input()
14042
- ], ObjectCardComponent.prototype, "borderButtonOptions", void 0);
14043
- ObjectCardComponent = ObjectCardComponent_1 = __decorate([
14204
+ HostListener("document:keydown", ["$event"])
14205
+ ], TieredMenuNestedComponent.prototype, "onKeydownHandler", null);
14206
+ TieredMenuNestedComponent = __decorate([
14044
14207
  Component({
14045
- selector: "s-object-card",
14046
- template: "<div [id]=\"id\" class=\"container\">\n <s-border-button\n *ngIf=\"\n borderButtonOptions?.visible\n ? borderButtonOptions?.visible(severity)\n : false\n \"\n [severity]=\"severity\"\n [options]=\"borderButtonOptions\"\n class=\"object-card__border-button\"\n [@BorderButtonAnimation]\n ></s-border-button>\n\n <div\n [id]=\"id + '-main-container'\"\n class=\"main-container\"\n [ngClass]=\"{\n 'with-hidden-fields': fields.length > maxVisibleFields,\n 'with-visible-fields': fields.length && maxVisibleFields,\n 'main-container--severity-default': severity === EnumSeverity.Default,\n 'main-container--severity-info': severity === EnumSeverity.Info,\n 'main-container--severity-warn': severity === EnumSeverity.Warn,\n 'main-container--severity-error': severity === EnumSeverity.Error,\n 'main-container--severity-success': severity == EnumSeverity.Success\n }\"\n >\n <div class=\"object-content\">\n <div class=\"s-object-card-main\"><ng-content select=\"s-object-card-main\"></ng-content></div>\n\n <div class=\"divider\" *ngIf=\"maxVisibleFields && fields.length\"></div>\n\n <div *ngFor=\"let field of (fields.toArray() | slice: 0:maxVisibleFields)\" class=\"s-object-card-field\">\n <ng-container *ngTemplateOutlet=\"field.content\"></ng-container>\n </div>\n </div>\n\n <div\n [id]=\"id + '-expand-icon-container'\"\n class=\"expand-icon-container\"\n (click)=\"toggle()\"\n [pTooltip]=\"expanded ? collapseTooltip : expandTooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n >\n <span [id]=\"id + '-expand-icon'\" class=\"expand-icon fa\" [ngClass]=\"{ 'fa-minus': expanded, 'fa-plus': !expanded }\"></span>\n </div>\n </div>\n\n <div\n [id]=\"id + '-expandable-container'\"\n [@expandableContent]=\"expanded\"\n class=\"expandable-container\"\n [ngClass]=\"{\n 'expandable-container--severity-default':\n severity === EnumSeverity.Default,\n 'expandable-container--severity-info': severity === EnumSeverity.Info,\n 'expandable-container--severity-warn': severity === EnumSeverity.Warn,\n 'expandable-container--severity-error': severity === EnumSeverity.Error,\n 'expandable-container--severity-success':\n severity == EnumSeverity.Success\n }\"\n >\n <div class=\"ui-g ui-g-12\">\n <ng-container\n *ngFor=\"\n let field of fields.toArray()\n | slice : maxVisibleFields : fields.length\n \"\n >\n <div class=\"ui-g-{{ getExpandedFieldWidth() }}\">\n <div class=\"s-object-card-field\">\n <ng-container\n *ngTemplateOutlet=\"field.content\"\n ></ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n</div>\n",
14047
- animations: [
14048
- trigger("expandableContent", [
14049
- state("*", style$7({
14050
- height: "0",
14051
- })),
14052
- state("false", style$7({
14053
- height: "0",
14054
- })),
14055
- state("true", style$7({
14056
- height: "*",
14057
- })),
14058
- transition("* => true", animate("200ms ease-out")),
14059
- transition("false <=> true", animate("200ms ease-out")),
14060
- ]),
14061
- trigger("BorderButtonAnimation", [
14062
- transition(":enter", [
14063
- style$7({ transform: "scaleY(0)", opacity: 0 }),
14064
- animate("300ms ease", style$7({ transform: "scaleY(1)", opacity: 1 })),
14065
- ]),
14066
- transition(":leave", [
14067
- style$7({ transform: "scaleY(1)", opacity: 1 }),
14068
- animate("300ms ease", style$7({ transform: "scaleY(0)", opacity: 0 })),
14069
- ]),
14070
- ]),
14071
- ],
14072
- styles: [":host{display:block}.container{margin-bottom:20px;position:relative}.main-container{display:-ms-flexbox;display:flex}.expandable-container,.main-container{background-color:#fff;border:1px solid #ccc;position:relative;overflow:hidden;width:100%}.expandable-container--severity-default{border-color:#ccc;border-top:initial}.expandable-container--severity-info{transition:border-color .5s;border-color:#428bca;border-top:initial}.expandable-container--severity-warn{transition:border-color .5s;border-color:#f8931f;border-top:initial}.expandable-container--severity-error{transition:border-color .5s;border-color:#c13018;border-top:initial}.expandable-container--severity-success{transition:border-color .5s;border-color:#0c9348;border-top:initial}.main-container--severity-default{border-color:#ccc}.main-container--severity-info{transition:border-color .5s;border-color:#428bca}.main-container--severity-warn{transition:border-color .5s;border-color:#f8931f}.main-container--severity-error{transition:border-color .5s;border-color:#c13018}.main-container--severity-success{transition:border-color .5s;border-color:#0c9348}.object-card__border-button{position:absolute;top:-13px;right:15px;z-index:1}.expandable-container{border-top:none;box-shadow:inset 0 6px 4px -4px #ddd;margin-top:-1px}.expand-icon-container{display:none;text-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;width:25px;position:absolute;right:15px;height:25px;top:calc(50% - 12px)}.expand-icon{-ms-flex:1;flex:1}.object-content{display:-ms-flexbox;display:flex;width:100%}.s-object-card-main{-ms-flex-negative:0;flex-shrink:0;-ms-flex-positive:1;flex-grow:1;overflow:hidden;padding:15px}.main-container.with-visible-fields .s-object-card-main{max-width:30%}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.main-container.with-visible-fields .s-object-card-main{width:20%}}.s-object-card-field{overflow:hidden;height:100%}.main-container .s-object-card-field{padding:15px}.main-container .divider{width:1px;-ms-flex-negative:0;flex-shrink:0;background-color:#ccc;margin:15px -1px 15px 0}.main-container.with-hidden-fields .object-content{width:calc(100% - 35px)}.main-container.with-hidden-fields .expand-icon-container{display:-ms-flexbox;display:flex}::ng-deep .object-card-button{padding-left:0!important;padding-right:10px!important;border:none!important;height:auto!important;min-width:auto!important;text-align:left!important}@media (max-width:767px){.s-object-card-main{max-width:calc(100% - 50px)}}"]
14208
+ template: "<div\n class=\"menu menu--nested\"\n [ngStyle]=\"{\n 'top': top + 'px',\n 'left': left + '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.visible && !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",
14209
+ 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:absolute;z-index:9999;overflow:auto;width:calc(100vw - 8px)}.menu .submenu{margin-left:24px}"]
14073
14210
  })
14074
- ], ObjectCardComponent);
14211
+ ], TieredMenuNestedComponent);
14075
14212
 
14076
- let BorderButtonComponent = class BorderButtonComponent {
14077
- constructor() {
14078
- this.severity = EnumSeverity.Default;
14079
- this.EnumSeverity = EnumSeverity;
14080
- this.TooltipPosition = TooltipPosition;
14213
+ var TieredMenuComponent_1;
14214
+ let TieredMenuComponent = TieredMenuComponent_1 = class TieredMenuComponent {
14215
+ constructor(_appRef, _componentFactoryResolver, _injector, _changeDetectorRef, tieredMenuService, _tieredMenuEventService) {
14216
+ this._appRef = _appRef;
14217
+ this._componentFactoryResolver = _componentFactoryResolver;
14218
+ this._injector = _injector;
14219
+ this._changeDetectorRef = _changeDetectorRef;
14220
+ this.tieredMenuService = tieredMenuService;
14221
+ this._tieredMenuEventService = _tieredMenuEventService;
14222
+ this.top = 0;
14223
+ this.left = 0;
14224
+ this.menuTriggerEvent = "hover";
14225
+ this._componentRef = null;
14226
+ this._unsubscribe$ = new Subject();
14227
+ this.destroyRequest = new EventEmitter();
14081
14228
  }
14082
- };
14083
- __decorate([
14084
- Input()
14085
- ], BorderButtonComponent.prototype, "severity", void 0);
14086
- __decorate([
14087
- Input()
14088
- ], BorderButtonComponent.prototype, "options", void 0);
14089
- BorderButtonComponent = __decorate([
14090
- Component({
14091
- selector: "s-border-button",
14092
- template: "<button\n class=\"border-button\"\n [ngClass]=\"{\n 'border-button--severity-default': severity === EnumSeverity.Default,\n 'border-button--severity-info': severity === EnumSeverity.Info,\n 'border-button--severity-warn': severity === EnumSeverity.Warn,\n 'border-button--severity-error': severity === EnumSeverity.Error,\n 'border-button--severity-success': severity == EnumSeverity.Success,\n 'border-button--disabled': options?.disabled\n ? options?.disabled(severity)\n : false\n }\"\n (click)=\"options?.onClick ? options?.onClick(severity) : null\"\n [sTooltip]=\"options?.tooltip ? options?.tooltip(severity) : null\"\n [tooltipPosition]=\"TooltipPosition.Left\"\n [disabled]=\"options?.disabled ? options?.disabled(severity) : false\"\n>\n <span class=\"border-button__label\">\n {{ options?.label ? options?.label(severity) : null }}\n </span>\n <span\n *ngIf=\"options?.icon ? options?.icon(severity) : false\"\n class=\"border-button__icon {{ options?.icon(severity) }}\"\n ></span>\n</button>",
14093
- styles: [".border-button{padding:0 8px;border:1px solid;border-radius:12px;height:23px;max-width:320px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.border-button__label{font-family:Open Sans,sans-serif;font-size:12px;line-height:150%;width:100%;display:block;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.border-button__icon{font-size:12px;color:#333;margin-left:8px}.border-button--severity-default{border-color:#ccc;background-color:#fff}.border-button--severity-info{border-color:#428bca;background-color:#d5e8ec;transition:background-color .5s,border-color .5s}.border-button--severity-info:enabled:hover{background-color:#9ecad4;cursor:pointer}.border-button--severity-info:enabled:active{transition:none;background-color:#67acbc;border-color:#67acbc}.border-button--severity-warn{border-color:#f8931f;background-color:#fce3ba;transition:background-color .5s,border-color .5s}.border-button--severity-warn:enabled:hover{background-color:#f8bf5e;cursor:pointer}.border-button--severity-warn:enabled:active{transition:none;background-color:#f5a319;border-color:#f5a319}.border-button--severity-error{border-color:#c13018;background-color:#fcd2d2;transition:background-color .5s,border-color .5s}.border-button--severity-error:enabled:hover{background-color:#f89696;cursor:pointer}.border-button--severity-error:enabled:active{transition:none;background-color:#f45b5b;border-color:#f45b5b}.border-button--severity-success{border-color:#0c9348;background-color:#e6ffb3;transition:background-color .5s,border-color .5s}.border-button--severity-success:enabled:hover{background-color:#c8ff5c;cursor:pointer}.border-button--severity-success:enabled:active{transition:none;background-color:#ade500;border-color:#ade500}.border-button--disabled:disabled:hover{cursor:default}"]
14094
- })
14095
- ], BorderButtonComponent);
14096
-
14097
- let BorderButtonModule = class BorderButtonModule {
14098
- };
14099
- BorderButtonModule = __decorate([
14100
- NgModule({
14101
- imports: [CommonModule, TooltipModule],
14102
- declarations: [BorderButtonComponent],
14103
- exports: [BorderButtonComponent]
14104
- })
14105
- ], BorderButtonModule);
14106
-
14107
- let ObjectCardModule = class ObjectCardModule {
14108
- };
14109
- ObjectCardModule = __decorate([
14110
- NgModule({
14111
- imports: [CommonModule, TooltipModule$1, ThumbnailModule, ButtonModule, BorderButtonModule],
14112
- declarations: [ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
14113
- exports: [ThumbnailModule, ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
14114
- })
14115
- ], ObjectCardModule);
14116
-
14117
- var ProductHeaderComponent_1;
14118
- let ProductHeaderComponent = ProductHeaderComponent_1 = class ProductHeaderComponent {
14119
- constructor() {
14120
- this.id = `s-product-header-${ProductHeaderComponent_1.nextId++}`;
14121
- this.baseZIndex = 0;
14122
- this.isHeaderFrame = true;
14229
+ onResize() {
14230
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
14123
14231
  }
14124
- ngAfterViewInit() {
14125
- this.container.nativeElement.style.zIndex = String(this.baseZIndex + ++DomHandler.zindex);
14126
- if (this.isHeaderFrame) {
14127
- this.container.nativeElement.style.borderBottom = "1px solid $default-secondary-color";
14128
- }
14129
- else {
14130
- this.container.nativeElement.style.borderTop = "1px solid $default-secondary-color";
14232
+ onDocumentClick(event) {
14233
+ // Closing menu when clicked outside.
14234
+ const target = event.target;
14235
+ const clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
14236
+ if (!clickedInside) {
14237
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
14131
14238
  }
14132
14239
  }
14133
- };
14134
- ProductHeaderComponent.nextId = 0;
14135
- __decorate([
14136
- Input()
14137
- ], ProductHeaderComponent.prototype, "id", void 0);
14138
- __decorate([
14139
- Input()
14140
- ], ProductHeaderComponent.prototype, "header", void 0);
14141
- __decorate([
14142
- Input()
14143
- ], ProductHeaderComponent.prototype, "baseZIndex", void 0);
14144
- __decorate([
14145
- Input()
14146
- ], ProductHeaderComponent.prototype, "isHeaderFrame", void 0);
14147
- __decorate([
14148
- ViewChild("headerContainer", { static: false })
14149
- ], ProductHeaderComponent.prototype, "container", void 0);
14150
- ProductHeaderComponent = ProductHeaderComponent_1 = __decorate([
14151
- Component({
14152
- selector: "s-product-header",
14153
- template: "<div [id]=\"id\" class=\"box\">\n <div\n #headerContainer\n class=\"sds-container\"\n [class]=\"isHeaderFrame ? 'header-frame' : 'primary-header'\"\n >\n <h1 [class]=\"isHeaderFrame ? 'title' : 'primary-title'\">{{ header }}</h1>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n",
14154
- styles: [".box{position:relative;width:100%;height:70px}.header-frame{padding-top:15px;padding-bottom:15px;width:100%;top:0;left:0;height:70px;background-color:#fff;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;position:fixed}.title{color:#999;font-weight:400;font-size:16pt;margin-right:15px;min-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{display:-ms-flexbox;display:flex;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.primary-header{display:-ms-flexbox;display:flex;width:100%;height:70px;padding:15px 20px;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;border-bottom:1px solid #ddd;background-color:#fff;gap:24px}@media (max-width:768px){.primary-header{width:100%}}.primary-header .primary-title{color:#999;font-weight:400;font-size:16pt;margin-right:15px;min-width:140px;overflow:hidden;text-overflow:ellipsis}"]
14155
- })
14156
- ], ProductHeaderComponent);
14157
-
14158
- let ProductHeaderModule = class ProductHeaderModule {
14159
- };
14160
- ProductHeaderModule = __decorate([
14161
- NgModule({
14162
- imports: [CommonModule, TooltipModule$1, ThumbnailModule],
14163
- declarations: [ProductHeaderComponent],
14164
- exports: [ProductHeaderComponent, ThumbnailModule],
14165
- })
14166
- ], ProductHeaderModule);
14167
-
14168
- var ProgressBarColors;
14169
- (function (ProgressBarColors) {
14170
- ProgressBarColors["Blue"] = "blue";
14171
- ProgressBarColors["Green"] = "green";
14172
- ProgressBarColors["Red"] = "red";
14173
- ProgressBarColors["Yellow"] = "yellow";
14174
- })(ProgressBarColors || (ProgressBarColors = {}));
14175
-
14176
- var ProgressBarMode;
14177
- (function (ProgressBarMode) {
14178
- ProgressBarMode["Determinate"] = "determinate";
14179
- ProgressBarMode["Indeterminate"] = "indeterminate";
14180
- })(ProgressBarMode || (ProgressBarMode = {}));
14181
-
14182
- let ProgressBarComponent = class ProgressBarComponent {
14183
- constructor() {
14184
- this.numberFormatOptions = {
14185
- style: "decimal",
14186
- minimumFractionDigits: 0,
14187
- maximumFractionDigits: 2,
14188
- };
14189
- this.showValue = true;
14190
- this.mode = ProgressBarMode.Determinate;
14240
+ onKeydownHandler(event) {
14241
+ switch (event.key) {
14242
+ case "Escape":
14243
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
14244
+ break;
14245
+ case " ":
14246
+ case "Enter":
14247
+ if (!this.tieredMenuService.currentItem.disabled) {
14248
+ this._tieredMenuEventService.selectItemEvent.emit(this.tieredMenuService.currentItem);
14249
+ }
14250
+ break;
14251
+ case "ArrowLeft":
14252
+ if (this.items.includes(this.tieredMenuService.currentItem)) {
14253
+ this._tieredMenuEventService.closeItemMenuEvent.emit(this.tieredMenuService.currentItem);
14254
+ this._changeDetectorRef.detectChanges();
14255
+ }
14256
+ break;
14257
+ case "ArrowRight":
14258
+ if (!this.tieredMenuService.currentItem.disabled && this.items.includes(this.tieredMenuService.currentItem)) {
14259
+ this._tieredMenuEventService.openItemMenuEvent.emit(this.tieredMenuService.currentItem);
14260
+ event.stopImmediatePropagation();
14261
+ }
14262
+ break;
14263
+ case "ArrowUp":
14264
+ if (!this.tieredMenuService.currentItem || this.items.includes(this.tieredMenuService.currentItem)) {
14265
+ this._tieredMenuEventService.decrementCurrentItemEvent.emit();
14266
+ event.stopImmediatePropagation();
14267
+ }
14268
+ break;
14269
+ case "ArrowDown":
14270
+ if (!this.tieredMenuService.currentItem || this.items.includes(this.tieredMenuService.currentItem)) {
14271
+ this._tieredMenuEventService.incrementCurrentItemEvent.emit();
14272
+ event.stopImmediatePropagation();
14273
+ }
14274
+ break;
14275
+ }
14191
14276
  }
14192
14277
  ngOnInit() {
14193
- this.validateInputs();
14278
+ this.tieredMenuService.currentItems = this.items;
14279
+ this._subscribeEvents();
14194
14280
  }
14195
- validateInputs() {
14196
- if (this.value < 0 || this.value > 100) {
14197
- throw new Error("Invalid value for value");
14281
+ ngOnDestroy() {
14282
+ this._unsubscribe$.next();
14283
+ this._unsubscribe$.complete();
14284
+ }
14285
+ _incrementCurItem() {
14286
+ if (!this.tieredMenuService.currentItem) {
14287
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14288
+ return;
14198
14289
  }
14199
- if (this.targetValue < 0 || this.targetValue > 100) {
14200
- throw new Error("Invalid value for targetValue");
14290
+ else if (!this.items.includes(this.tieredMenuService.currentItem)) {
14291
+ // Checking if it is the current menu.
14292
+ return;
14201
14293
  }
14202
- if (this.mode === ProgressBarMode.Indeterminate && (this.value || this.targetValue || this.targetLabel)) {
14203
- throw new Error("When the mode is indeterminate, the value, targetValue and targetLabel parameters are not expected.");
14294
+ const currentIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
14295
+ if (currentIndex < this.tieredMenuService.currentItems.length) {
14296
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[currentIndex];
14297
+ }
14298
+ else {
14299
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14300
+ }
14301
+ if (this.tieredMenuService.currentItem.divider) {
14302
+ this._incrementCurItem();
14204
14303
  }
14205
14304
  }
14206
- };
14207
- __decorate([
14208
- Input()
14209
- ], ProgressBarComponent.prototype, "value", void 0);
14210
- __decorate([
14211
- Input()
14212
- ], ProgressBarComponent.prototype, "numberFormatOptions", void 0);
14213
- __decorate([
14214
- Input()
14215
- ], ProgressBarComponent.prototype, "targetValue", void 0);
14216
- __decorate([
14217
- Input()
14218
- ], ProgressBarComponent.prototype, "label", void 0);
14219
- __decorate([
14220
- Input()
14221
- ], ProgressBarComponent.prototype, "targetLabel", void 0);
14222
- __decorate([
14223
- Input()
14224
- ], ProgressBarComponent.prototype, "activeColor", void 0);
14225
- __decorate([
14226
- Input()
14227
- ], ProgressBarComponent.prototype, "showValue", void 0);
14228
- __decorate([
14229
- Input()
14230
- ], ProgressBarComponent.prototype, "mode", void 0);
14231
- ProgressBarComponent = __decorate([
14232
- Component({
14233
- selector: "s-progressbar",
14234
- template: "<ng-container *ngIf=\"mode === 'determinate'; then pbDeterminateTemplate else pbIndeterminateTemplate\"></ng-container>\n\n<ng-template #pbDeterminateTemplate>\n <s-progressbar-determinate\n [value]=\"value\"\n [numberFormatOptions]=\"numberFormatOptions\"\n [targetValue]=\"targetValue\"\n [targetLabel]=\"targetLabel\"\n [activeColor]=\"activeColor\"\n [showValue]=\"showValue\">\n </s-progressbar-determinate>\n</ng-template>\n\n<ng-template #pbIndeterminateTemplate>\n <s-progressbar-indeterminate\n [activeColor]=\"activeColor\"\n [label]=\"label\">\n </s-progressbar-indeterminate>\n</ng-template>",
14235
- styles: [".progress-bar{position:relative}.progress-bar .progress-bar-all{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progress-bar .progress-bar-all .progress-bar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progress-bar .progress-bar-all .progress-bar-active--blue{background-color:#428bca}.progress-bar .progress-bar-all .progress-bar-active--green{background-color:#0c9348}.progress-bar .progress-bar-all .progress-bar-active--red{background-color:#c13018}.progress-bar .progress-bar-all .progress-bar-active--yellow{background-color:#fcbf10}.progress-bar .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progress-bar .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progress-bar .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
14236
- })
14237
- ], ProgressBarComponent);
14238
-
14239
- let ProgressBarDeterminateComponent = class ProgressBarDeterminateComponent {
14240
- constructor(localeService) {
14241
- this.localeService = localeService;
14242
- this.showValue = true;
14243
- }
14244
- ngOnInit() {
14245
- this.validateValues();
14246
- this.onGetLocale();
14305
+ _decrementCurItem() {
14306
+ if (!this.tieredMenuService.currentItem) {
14307
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
14308
+ return;
14309
+ // Checking if it is the current menu.
14310
+ }
14311
+ else if (!this.items.includes(this.tieredMenuService.currentItem)) {
14312
+ return;
14313
+ }
14314
+ const curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
14315
+ if (curIndex >= 0) {
14316
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
14317
+ }
14318
+ else {
14319
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
14320
+ }
14321
+ if (this.tieredMenuService.currentItem.divider) {
14322
+ this._decrementCurItem();
14323
+ }
14247
14324
  }
14248
- onGetLocale() {
14249
- this.localeService.getLocale().subscribe({
14250
- next: (locale) => {
14251
- this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", this.numberFormatOptions);
14252
- },
14253
- error: () => {
14254
- this.numberFormat = new Intl.NumberFormat("pt-BR", this.numberFormatOptions);
14255
- },
14256
- });
14325
+ _createMenu(items, position) {
14326
+ if (!this._componentRef && items) {
14327
+ const componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent_1);
14328
+ this._componentRef = componentFactory.create(this._injector);
14329
+ this._appRef.attachView(this._componentRef.hostView);
14330
+ const domElem = this._componentRef.hostView.rootNodes[0];
14331
+ document.body.appendChild(domElem);
14332
+ // Setting the menu items.
14333
+ this._componentRef.instance.items = items;
14334
+ // Subscribe menu events.
14335
+ this._componentRef.instance.destroyRequest.subscribe((propagate) => {
14336
+ this._destroy(propagate);
14337
+ });
14338
+ this._menuDivElement = domElem.querySelector(".menu");
14339
+ this._setMenuPosition(position);
14340
+ }
14257
14341
  }
14258
- validateValues() {
14259
- if (this.value < 0 || this.value > 100) {
14260
- throw new Error("Invalid value for value");
14342
+ _destroy(propagate = true) {
14343
+ if (this._componentRef !== null) {
14344
+ this._appRef.detachView(this._componentRef.hostView);
14345
+ this._componentRef.destroy();
14346
+ this._componentRef = null;
14347
+ this._menuDivElement = null;
14261
14348
  }
14262
- if (this.targetValue < 0 || this.targetValue > 100) {
14263
- throw new Error("Invalid value for targetValue");
14349
+ if (propagate) {
14350
+ this.destroyRequest.emit();
14351
+ }
14352
+ }
14353
+ _setMenuPosition(position) {
14354
+ var _a, _b;
14355
+ const ITEM_HEIGHT = 37;
14356
+ const DIVIDER_HEIGHT = 5;
14357
+ const PADDING = 8;
14358
+ if (this._componentRef !== null) {
14359
+ const { top, right, bottom, left } = position;
14360
+ const itemsCount = (_a = this._componentRef.instance.items) === null || _a === void 0 ? void 0 : _a.reduce((count, item) => {
14361
+ return !item.divider ? count + 1 : count;
14362
+ }, 0);
14363
+ const dividersCount = (_b = this._componentRef.instance.items) === null || _b === void 0 ? void 0 : _b.reduce((count, item) => {
14364
+ return item.divider ? count + 1 : count;
14365
+ }, 0);
14366
+ // I need to calculate the height of the component because the internal elements have not been created yet.
14367
+ const menuHeight = itemsCount * ITEM_HEIGHT + dividersCount * DIVIDER_HEIGHT + PADDING + 8;
14368
+ const menuWidth = this._menuDivElement.getBoundingClientRect().width;
14369
+ const rightFreeSpace = window.innerWidth - right;
14370
+ const bottomFreeSpace = window.innerHeight - bottom;
14371
+ if (rightFreeSpace > menuWidth) {
14372
+ this._componentRef.instance.left = right;
14373
+ }
14374
+ else {
14375
+ this._componentRef.instance.left = left - menuWidth;
14376
+ }
14377
+ if (bottomFreeSpace <= menuHeight) {
14378
+ this._componentRef.instance.top = Math.max(window.innerHeight - menuHeight, window.scrollY);
14379
+ }
14380
+ else {
14381
+ this._componentRef.instance.top = window.scrollY + top;
14382
+ }
14264
14383
  }
14265
14384
  }
14385
+ _subscribeEvents() {
14386
+ // Increment current item event.
14387
+ this._tieredMenuEventService.incrementCurrentItemEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
14388
+ this._incrementCurItem();
14389
+ });
14390
+ // Decrement current item event.
14391
+ this._tieredMenuEventService.decrementCurrentItemEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
14392
+ this._decrementCurItem();
14393
+ });
14394
+ // Select item event.
14395
+ this._tieredMenuEventService.selectItemEvent.pipe(takeUntil(this._unsubscribe$)).subscribe((item) => {
14396
+ if (item.submenu) {
14397
+ this._tieredMenuEventService.openItemMenuEvent.emit(item);
14398
+ }
14399
+ else if (item.command) {
14400
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
14401
+ item.command();
14402
+ }
14403
+ });
14404
+ // Close all menus event.
14405
+ this._tieredMenuEventService.closeAllMenusEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
14406
+ this._destroy();
14407
+ this.tieredMenuService.currentItem = null;
14408
+ this.tieredMenuService.currentItems = this.tieredMenuService.items;
14409
+ this.tieredMenuService.markAllItemsAsClosed(this.tieredMenuService.items);
14410
+ });
14411
+ // Open item menu event.
14412
+ this._tieredMenuEventService.openItemMenuEvent.pipe(takeUntil(this._unsubscribe$)).subscribe((item) => {
14413
+ if (this.tieredMenuService.currentItem) {
14414
+ if (this.tieredMenuService.currentItem.parent === item) {
14415
+ return;
14416
+ }
14417
+ if (!this.tieredMenuService.searchTheHierarchy(this.tieredMenuService.currentItem.parent, item)) {
14418
+ let current = this.tieredMenuService.currentItem;
14419
+ current.isOpen = false;
14420
+ while ((current === null || current === void 0 ? void 0 : current.parent) !== item.parent) {
14421
+ this._tieredMenuEventService.closeItemMenuEvent.emit(current);
14422
+ this._changeDetectorRef.detectChanges();
14423
+ current = current.parent;
14424
+ }
14425
+ if (current) {
14426
+ current.isOpen = false;
14427
+ }
14428
+ }
14429
+ }
14430
+ if (item.submenu && !item.isOpen && this.items.includes(item)) {
14431
+ const { top, right, left, bottom } = document.querySelector(`#${item.id}`).getBoundingClientRect();
14432
+ const position = { top, right, left, bottom };
14433
+ this._createMenu(item.submenu, position);
14434
+ this.tieredMenuService.currentItems = item.submenu;
14435
+ this.tieredMenuService.currentItem = item.submenu[0];
14436
+ item.isOpen = true;
14437
+ }
14438
+ });
14439
+ // Close item menu event.
14440
+ this._tieredMenuEventService.closeItemMenuEvent
14441
+ .pipe(takeUntil(this._unsubscribe$))
14442
+ .subscribe((item) => {
14443
+ var _a, _b;
14444
+ if (this.items.some((i) => i.id === item.id)) {
14445
+ if (item.parent) {
14446
+ item.parent.isOpen = false;
14447
+ }
14448
+ 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;
14449
+ this.tieredMenuService.currentItem = item.parent;
14450
+ this.destroyRequest.emit(false);
14451
+ }
14452
+ });
14453
+ }
14266
14454
  };
14267
- ProgressBarDeterminateComponent.ctorParameters = () => [
14268
- { type: LocaleService }
14455
+ TieredMenuComponent.ctorParameters = () => [
14456
+ { type: ApplicationRef },
14457
+ { type: ComponentFactoryResolver },
14458
+ { type: Injector },
14459
+ { type: ChangeDetectorRef },
14460
+ { type: TieredMenuService },
14461
+ { type: TieredMenuEventService }
14269
14462
  ];
14270
14463
  __decorate([
14271
- Input()
14272
- ], ProgressBarDeterminateComponent.prototype, "value", void 0);
14273
- __decorate([
14274
- Input()
14275
- ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
14276
- __decorate([
14277
- Input()
14278
- ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
14279
- __decorate([
14280
- Input()
14281
- ], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
14282
- __decorate([
14283
- Input()
14284
- ], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
14464
+ Output()
14465
+ ], TieredMenuComponent.prototype, "destroyRequest", void 0);
14285
14466
  __decorate([
14286
- Input()
14287
- ], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
14288
- ProgressBarDeterminateComponent = __decorate([
14289
- Component({
14290
- selector: "s-progressbar-determinate",
14291
- template: "<div class=\"progressbar-determinate\">\n <div class=\"progressbar-container\">\n <div\n class=\"progressbar-active\"\n [ngClass]=\"{\n 'progressbar-active--blue' : activeColor === 'blue',\n 'progressbar-active--green': activeColor === 'green',\n 'progressbar-active--red': activeColor === 'red',\n 'progressbar-active--yellow': activeColor === 'yellow'\n }\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n\n {{ showValue && value ? numberFormat.format(value) + '%' : '' }}\n </div>\n </div>\n <div\n *ngIf=\"targetValue\"\n class=\"target\"\n [ngStyle]=\"{\n 'left': targetValue <= 50 ? targetValue + '%' : 'unset',\n 'right': targetValue > 50 ? 100 - targetValue + '%' : 'unset',\n 'align-items': targetValue > 50 ? 'flex-end' : 'flex-start'\n }\">\n <span class=\"target-line\"></span>\n <span class=\"target-label\">\n {{ targetLabel || numberFormat.format(value) + '%' }}\n </span>\n </div>\n </div>\n",
14292
- styles: [".progressbar-determinate{position:relative}.progressbar-determinate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progressbar-determinate .progressbar-container .progressbar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progressbar-determinate .progressbar-container .progressbar-active--blue{background-color:#428bca}.progressbar-determinate .progressbar-container .progressbar-active--green{background-color:#0c9348}.progressbar-determinate .progressbar-container .progressbar-active--red{background-color:#c13018}.progressbar-determinate .progressbar-container .progressbar-active--yellow{background-color:#fcbf10;color:#212533}.progressbar-determinate .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progressbar-determinate .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progressbar-determinate .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
14293
- })
14294
- ], ProgressBarDeterminateComponent);
14295
-
14296
- let ProgressBarIndeterminateComponent = class ProgressBarIndeterminateComponent {
14297
- };
14467
+ HostListener("window:resize")
14468
+ ], TieredMenuComponent.prototype, "onResize", null);
14298
14469
  __decorate([
14299
- Input()
14300
- ], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
14470
+ HostListener("document:click", ["$event"])
14471
+ ], TieredMenuComponent.prototype, "onDocumentClick", null);
14301
14472
  __decorate([
14302
- Input()
14303
- ], ProgressBarIndeterminateComponent.prototype, "label", void 0);
14304
- ProgressBarIndeterminateComponent = __decorate([
14473
+ HostListener("document:keydown", ["$event"])
14474
+ ], TieredMenuComponent.prototype, "onKeydownHandler", null);
14475
+ TieredMenuComponent = TieredMenuComponent_1 = __decorate([
14305
14476
  Component({
14306
- selector: "s-progressbar-indeterminate",
14307
- template: "<div class=\"progressbar-indeterminate\">\n <div class=\"progressbar-container\">\n <div class=\"indeterminate-bar\" [ngClass]=\"{\n 'indeterminate-bar--blue': activeColor === 'blue',\n 'indeterminate-bar--green': activeColor === 'green',\n 'indeterminate-bar--red': activeColor === 'red',\n 'indeterminate-bar--yellow': activeColor === 'yellow'\n }\"></div>\n </div>\n\n <span *ngIf=\"label\" class=\"progressbar-label\">{{ label }}</span>\n</div>\n",
14308
- styles: [".progressbar-indeterminate{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.progressbar-indeterminate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;margin:8px 0;overflow:hidden;width:100%}.progressbar-indeterminate .indeterminate-bar{animation:5s infinite indeterminate-progress;background-color:#428bca;height:100%;width:40%}.progressbar-indeterminate .indeterminate-bar--blue{background-color:#428bca}.progressbar-indeterminate .indeterminate-bar--green{background-color:#0c9348}.progressbar-indeterminate .indeterminate-bar--red{background-color:#c13018}.progressbar-indeterminate .indeterminate-bar--yellow{background-color:#fcbf10}.progressbar-indeterminate .progressbar-label{font-family:\"Open Sans\" sans-serif;font-size:12px;line-height:150%;color:#212533}@keyframes indeterminate-progress{0%{transform:translateX(-250%)}100%{transform:translateX(250%)}}"]
14477
+ selector: "s-tiered-menu",
14478
+ template: "<div\n class=\"menu\"\n [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.visible && !item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [highlight]=\"item.isOpen\"\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>",
14479
+ 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;max-height:100vh;min-width:176px;padding:4px 0;overflow-y:auto;position:absolute;z-index:9999}"]
14309
14480
  })
14310
- ], ProgressBarIndeterminateComponent);
14481
+ ], TieredMenuComponent);
14311
14482
 
14312
- let ProgressBarModule = class ProgressBarModule {
14483
+ let TieredMenuGlobalService = class TieredMenuGlobalService {
14313
14484
  };
14314
- ProgressBarModule = __decorate([
14315
- NgModule({
14316
- imports: [CommonModule],
14317
- declarations: [
14318
- ProgressBarComponent,
14319
- ProgressBarDeterminateComponent,
14320
- ProgressBarIndeterminateComponent,
14321
- ],
14322
- exports: [ProgressBarComponent],
14323
- })
14324
- ], ProgressBarModule);
14485
+ TieredMenuGlobalService = __decorate([
14486
+ Injectable()
14487
+ ], TieredMenuGlobalService);
14325
14488
 
14326
- let PanelComponent = class PanelComponent {
14327
- constructor() {
14328
- this.toggleable = true;
14329
- this.collapsed = false;
14330
- this.severity = EnumSeverity.Default;
14331
- this.collapsedChange = new EventEmitter();
14332
- this.EnumSeverity = EnumSeverity;
14333
- }
14334
- onCollapsedChange(collapsed) {
14335
- this.collapsed = collapsed;
14336
- this.collapsedChange.emit(this.collapsed);
14489
+ let TieredMenuDirective = class TieredMenuDirective {
14490
+ constructor(_elementRef, _appRef, _componentFactoryResolver, _injector, _tieredMenuEventService, _tieredMenuService, _tieredMenuGlobalService, _changeDetectorRef) {
14491
+ this._elementRef = _elementRef;
14492
+ this._appRef = _appRef;
14493
+ this._componentFactoryResolver = _componentFactoryResolver;
14494
+ this._injector = _injector;
14495
+ this._tieredMenuEventService = _tieredMenuEventService;
14496
+ this._tieredMenuService = _tieredMenuService;
14497
+ this._tieredMenuGlobalService = _tieredMenuGlobalService;
14498
+ this._changeDetectorRef = _changeDetectorRef;
14499
+ this.items = [];
14500
+ this.triggerEvent = "click";
14501
+ this._componentRef = null;
14502
+ this._isNested = false;
14503
+ this._isOpen = false;
14504
+ this._unsubscribe$ = new Subject();
14505
+ }
14506
+ onClick(event) {
14507
+ if (this.triggerEvent === "click" && !this._isOpen) {
14508
+ this._lastActiveElement = document.activeElement;
14509
+ this._createMenu();
14510
+ event.preventDefault();
14511
+ event.stopPropagation();
14512
+ }
14513
+ }
14514
+ ngOnInit() {
14515
+ this._subscribeEvents();
14516
+ }
14517
+ ngDoCheck() {
14518
+ if (!this.previousItems) {
14519
+ this.previousItems = this._tieredMenuService.cloneItems(this.items);
14520
+ }
14521
+ let hasChanges = false;
14522
+ if (this.items.length !== this.previousItems.length) {
14523
+ hasChanges = true;
14524
+ }
14525
+ else {
14526
+ for (let i = 0; i < this.items.length; i++) {
14527
+ if (!this._compareItems(this.items[i], this.previousItems[i])) {
14528
+ hasChanges = true;
14529
+ break;
14530
+ }
14531
+ }
14532
+ }
14533
+ if (hasChanges) {
14534
+ this._updateServiceItems();
14535
+ this._changeDetectorRef.detectChanges();
14536
+ this._rebuildMenu();
14537
+ }
14538
+ this.previousItems = this._tieredMenuService.cloneItems(this.items);
14539
+ }
14540
+ ngOnDestroy() {
14541
+ this._unsubscribe$.next();
14542
+ this._unsubscribe$.complete();
14543
+ this._destroy();
14544
+ }
14545
+ _createMenu() {
14546
+ var _a, _b, _c;
14547
+ this._updateServiceItems();
14548
+ if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
14549
+ (_b = this._tieredMenuGlobalService.lastInstance) === null || _b === void 0 ? void 0 : _b._destroy();
14550
+ this._tieredMenuGlobalService.lastInstance = this;
14551
+ (_c = this._lastActiveElement) === null || _c === void 0 ? void 0 : _c.blur();
14552
+ this._isOpen = true;
14553
+ this._isNested = document.body.clientWidth < 600;
14554
+ this._isNested ? this._createNestedMenu() : this._createTieredMenu();
14555
+ }
14556
+ }
14557
+ _createTieredMenu() {
14558
+ var _a;
14559
+ if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
14560
+ const componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent);
14561
+ this._componentRef = componentFactory.create(this._injector);
14562
+ this._appRef.attachView(this._componentRef.hostView);
14563
+ const domElem = this._componentRef.hostView.rootNodes[0];
14564
+ document.body.appendChild(domElem);
14565
+ this._setMenuComponentProperties();
14566
+ this._componentRef.instance.destroyRequest.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
14567
+ this._destroy();
14568
+ });
14569
+ this._setMenuPosition();
14570
+ }
14571
+ }
14572
+ _createNestedMenu() {
14573
+ var _a;
14574
+ if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
14575
+ const componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuNestedComponent);
14576
+ this._componentRef = componentFactory.create(this._injector);
14577
+ this._appRef.attachView(this._componentRef.hostView);
14578
+ const domElem = this._componentRef.hostView.rootNodes[0];
14579
+ document.body.appendChild(domElem);
14580
+ this._setMenuComponentProperties();
14581
+ this._setMenuPosition();
14582
+ }
14583
+ }
14584
+ _destroy() {
14585
+ if (this._componentRef) {
14586
+ this._isOpen = false;
14587
+ window.clearTimeout(this._showTimeout);
14588
+ this._appRef.detachView(this._componentRef.hostView);
14589
+ this._componentRef.destroy();
14590
+ this._componentRef = null;
14591
+ this._tieredMenuService.currentItems = this._tieredMenuService.items;
14592
+ this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
14593
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
14594
+ }
14595
+ }
14596
+ _setMenuPosition() {
14597
+ var _a, _b;
14598
+ const ITEM_HEIGHT = 37;
14599
+ const ITEM_WIDTH = 176;
14600
+ const DIVIDER_HEIGHT = 5;
14601
+ const PADDING = 8;
14602
+ const MARGIN = 4;
14603
+ if (this._componentRef !== null) {
14604
+ this._componentRef.instance.top = 8;
14605
+ let { bottom, left, right } = this._elementRef.nativeElement.getBoundingClientRect();
14606
+ const itemsCount = (_a = this._componentRef.instance.items) === null || _a === void 0 ? void 0 : _a.reduce((count, item) => {
14607
+ return !item.divider ? count + 1 : count;
14608
+ }, 0);
14609
+ const dividersCount = (_b = this._componentRef.instance.items) === null || _b === void 0 ? void 0 : _b.reduce((count, item) => {
14610
+ return item.divider ? count + 1 : count;
14611
+ }, 0);
14612
+ const menuHeight = itemsCount * ITEM_HEIGHT + dividersCount * DIVIDER_HEIGHT + PADDING + MARGIN;
14613
+ const rightFreeSpace = window.innerWidth - right;
14614
+ const bottomFreeSpace = window.innerHeight - bottom;
14615
+ this._componentRef.instance.top = bottom;
14616
+ this._componentRef.instance.left = left;
14617
+ if (bottomFreeSpace <= menuHeight) {
14618
+ this._componentRef.instance.top = Math.max(scrollY + bottom - menuHeight, 0);
14619
+ }
14620
+ else {
14621
+ this._componentRef.instance.top = window.scrollY + bottom + MARGIN;
14622
+ }
14623
+ if (rightFreeSpace > 176) {
14624
+ this._componentRef.instance.left = window.scrollX + left;
14625
+ }
14626
+ else {
14627
+ this._componentRef.instance.left = window.scrollX + right - ITEM_WIDTH;
14628
+ }
14629
+ if (this._isNested) {
14630
+ this._componentRef.instance.left = MARGIN;
14631
+ }
14632
+ }
14633
+ }
14634
+ _setMenuComponentProperties() {
14635
+ if (this._componentRef != null) {
14636
+ this._componentRef.instance.items = this._tieredMenuService.items;
14637
+ }
14638
+ }
14639
+ _subscribeEvents() {
14640
+ this._tieredMenuEventService.closeAllMenusEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
14641
+ this._tieredMenuService.items = this._tieredMenuService.markAllItemsAsClosed(this._tieredMenuService.items);
14642
+ this._destroy();
14643
+ });
14644
+ }
14645
+ _compareItems(item1, item2) {
14646
+ return JSON.stringify(item1) === JSON.stringify(item2);
14647
+ }
14648
+ _rebuildMenu() {
14649
+ this._destroy();
14650
+ }
14651
+ _updateServiceItems() {
14652
+ this._tieredMenuService.items = this._tieredMenuService.normalizeData(this.items);
14653
+ this._tieredMenuService.currentItems = this._tieredMenuService.items;
14654
+ this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
14337
14655
  }
14338
14656
  };
14657
+ TieredMenuDirective.ctorParameters = () => [
14658
+ { type: ElementRef },
14659
+ { type: ApplicationRef },
14660
+ { type: ComponentFactoryResolver },
14661
+ { type: Injector },
14662
+ { type: TieredMenuEventService },
14663
+ { type: TieredMenuService },
14664
+ { type: TieredMenuGlobalService },
14665
+ { type: ChangeDetectorRef }
14666
+ ];
14339
14667
  __decorate([
14340
14668
  Input()
14341
- ], PanelComponent.prototype, "header", void 0);
14342
- __decorate([
14343
- Input()
14344
- ], PanelComponent.prototype, "toggleable", void 0);
14345
- __decorate([
14346
- Input()
14347
- ], PanelComponent.prototype, "collapsed", void 0);
14348
- __decorate([
14349
- Input()
14350
- ], PanelComponent.prototype, "severity", void 0);
14669
+ ], TieredMenuDirective.prototype, "items", void 0);
14351
14670
  __decorate([
14352
14671
  Input()
14353
- ], PanelComponent.prototype, "borderButtonOptions", void 0);
14672
+ ], TieredMenuDirective.prototype, "triggerEvent", void 0);
14354
14673
  __decorate([
14355
- Output()
14356
- ], PanelComponent.prototype, "collapsedChange", void 0);
14357
- PanelComponent = __decorate([
14358
- Component({
14359
- selector: "s-panel",
14360
- template: "<p-panel\n [toggleable]=\"toggleable\"\n [collapsed]=\"collapsed\"\n [ngClass]=\"{\n 'panel--severity-default': severity === EnumSeverity.Default,\n 'panel--severity-info': severity === EnumSeverity.Info,\n 'panel--severity-warn': severity === EnumSeverity.Warn,\n 'panel--severity-error': severity === EnumSeverity.Error,\n 'panel--severity-success': severity == EnumSeverity.Success\n }\"\n (collapsedChange)=\"onCollapsedChange($event)\"\n>\n <p-header>\n <s-border-button\n *ngIf=\"\n borderButtonOptions?.visible\n ? borderButtonOptions?.visible(severity)\n : false\n \"\n [severity]=\"severity\"\n [options]=\"borderButtonOptions\"\n class=\"panel__border-button\"\n [@BorderButtonAnimation]\n ></s-border-button>\n <span>\n {{ header }}\n </span>\n </p-header>\n\n <ng-content></ng-content>\n</p-panel>",
14361
- animations: [
14362
- trigger("BorderButtonAnimation", [
14363
- transition(":enter", [
14364
- style$7({ transform: "scaleY(0)", opacity: 0 }),
14365
- animate("300ms ease", style$7({ transform: "scaleY(1)", opacity: 1 })),
14366
- ]),
14367
- transition(":leave", [
14368
- style$7({ transform: "scaleY(1)", opacity: 1 }),
14369
- animate("300ms ease", style$7({ transform: "scaleY(0)", opacity: 0 })),
14370
- ]),
14371
- ]),
14674
+ HostListener("click", ["$event"])
14675
+ ], TieredMenuDirective.prototype, "onClick", null);
14676
+ TieredMenuDirective = __decorate([
14677
+ Directive({
14678
+ selector: "[sTieredMenu]",
14679
+ providers: [TieredMenuEventService, TieredMenuService],
14680
+ })
14681
+ ], TieredMenuDirective);
14682
+
14683
+ let TieredMenuModule = class TieredMenuModule {
14684
+ };
14685
+ TieredMenuModule = __decorate([
14686
+ NgModule({
14687
+ imports: [
14688
+ CommonModule,
14372
14689
  ],
14373
- styles: [":host{display:block}:host ::ng-deep .ui-panel{position:relative}:host ::ng-deep .panel--severity-default .ui-panel{border-color:#ccc}:host ::ng-deep .panel--severity-info .ui-panel{border-color:#428bca;transition:border-color .5s}:host ::ng-deep .panel--severity-warn .ui-panel{border-color:#f8931f;transition:border-color .5s}:host ::ng-deep .panel--severity-error .ui-panel{border-color:#c13018;transition:border-color .5s}:host ::ng-deep .panel--severity-success .ui-panel{border-color:#0c9348;transition:border-color .5s}.panel__border-button{position:absolute;top:-13px;right:15px;z-index:1}"]
14690
+ declarations: [
14691
+ TieredMenuDirective,
14692
+ TieredMenuComponent,
14693
+ TieredMenuNestedComponent,
14694
+ TieredMenuItemComponent,
14695
+ TieredMenuDividerComponent,
14696
+ ],
14697
+ exports: [TieredMenuDirective],
14698
+ providers: [TieredMenuGlobalService],
14374
14699
  })
14375
- ], PanelComponent);
14700
+ ], TieredMenuModule);
14376
14701
 
14377
- let PanelModule = class PanelModule {
14702
+ let NavigationButtonModule = class NavigationButtonModule {
14378
14703
  };
14379
- PanelModule = __decorate([
14704
+ NavigationButtonModule = __decorate([
14380
14705
  NgModule({
14381
- imports: [CommonModule, PanelModule$1, BorderButtonModule],
14382
- declarations: [PanelComponent],
14383
- exports: [PanelComponent],
14706
+ imports: [CommonModule, TieredMenuModule, TooltipModule],
14707
+ declarations: [NavigationButtonComponent],
14708
+ exports: [NavigationButtonComponent],
14384
14709
  })
14385
- ], PanelModule);
14710
+ ], NavigationButtonModule);
14386
14711
 
14387
- var RatingScaleComponent_1;
14388
- let RatingScaleComponent = RatingScaleComponent_1 = class RatingScaleComponent {
14712
+ var ObjectCardFieldComponent_1;
14713
+ let ObjectCardFieldComponent = ObjectCardFieldComponent_1 = class ObjectCardFieldComponent {
14389
14714
  constructor() {
14390
- this.disabled = false;
14391
- }
14392
- writeValue(value) {
14393
- if (!this.disabled) {
14394
- this.value = value;
14395
- }
14396
- }
14397
- registerOnChange(onChange) {
14398
- this._onChange = onChange;
14399
- }
14400
- registerOnTouched(onTouched) {
14401
- this._onTouched = onTouched;
14402
- }
14403
- onSelect(rating) {
14404
- this.value = rating;
14405
- if (this._onChange) {
14406
- this._onChange(this.value);
14407
- }
14715
+ this.id = `s-object-card-field-${ObjectCardFieldComponent_1.nextId++}`;
14716
+ this.buttonClick = new EventEmitter();
14408
14717
  }
14409
14718
  };
14719
+ ObjectCardFieldComponent.nextId = 0;
14410
14720
  __decorate([
14411
14721
  Input()
14412
- ], RatingScaleComponent.prototype, "nodes", void 0);
14722
+ ], ObjectCardFieldComponent.prototype, "id", void 0);
14413
14723
  __decorate([
14414
14724
  Input()
14415
- ], RatingScaleComponent.prototype, "startLabel", void 0);
14725
+ ], ObjectCardFieldComponent.prototype, "imageSource", void 0);
14416
14726
  __decorate([
14417
14727
  Input()
14418
- ], RatingScaleComponent.prototype, "endLabel", void 0);
14728
+ ], ObjectCardFieldComponent.prototype, "imageAlt", void 0);
14419
14729
  __decorate([
14420
14730
  Input()
14421
- ], RatingScaleComponent.prototype, "disabled", void 0);
14422
- RatingScaleComponent = RatingScaleComponent_1 = __decorate([
14731
+ ], ObjectCardFieldComponent.prototype, "iconClass", void 0);
14732
+ __decorate([
14733
+ Input()
14734
+ ], ObjectCardFieldComponent.prototype, "label", void 0);
14735
+ __decorate([
14736
+ Input()
14737
+ ], ObjectCardFieldComponent.prototype, "description", void 0);
14738
+ __decorate([
14739
+ Input()
14740
+ ], ObjectCardFieldComponent.prototype, "buttonLabel", void 0);
14741
+ __decorate([
14742
+ Input()
14743
+ ], ObjectCardFieldComponent.prototype, "buttonModel", void 0);
14744
+ __decorate([
14745
+ Output()
14746
+ ], ObjectCardFieldComponent.prototype, "buttonClick", void 0);
14747
+ __decorate([
14748
+ ContentChild(ThumbnailComponent, { static: true })
14749
+ ], ObjectCardFieldComponent.prototype, "thumbnailComponent", void 0);
14750
+ __decorate([
14751
+ ViewChild(TemplateRef, { static: true })
14752
+ ], ObjectCardFieldComponent.prototype, "content", void 0);
14753
+ ObjectCardFieldComponent = ObjectCardFieldComponent_1 = __decorate([
14423
14754
  Component({
14424
- selector: "s-rating-scale",
14425
- template: "<div\n class=\"rating-scale\"\n [ngClass]=\"{ 'rating-scale--disabled': disabled }\">\n <div class=\"nodes\">\n <button\n *ngFor=\"let node of nodes; index as i\"\n class=\"node\"\n [ngClass]=\"{ 'node--selected': value?.id === node.id && !disabled }\"\n tabindex=\"0\"\n (click)=\"onSelect(node)\"> \n <span\n *ngIf=\"node.icon\"\n class=\"icon fas\"\n [ngClass]=\"node.icon\">\n </span>\n <span\n *ngIf=\"node.title\"\n class=\"label\">\n {{ node.title }}\n </span>\n </button>\n </div>\n <div class=\"labels\">\n <span>{{ startLabel }}</span>\n <span>{{ endLabel }}</span>\n </div>\n</div>",
14426
- providers: [{
14427
- provide: NG_VALUE_ACCESSOR,
14428
- useExisting: forwardRef(() => RatingScaleComponent_1),
14429
- multi: true,
14430
- }],
14431
- styles: [".rating-scale{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.rating-scale .nodes{display:-ms-flexbox;display:flex}.rating-scale .nodes .node{-ms-flex-align:center;align-items:center;background-color:#fff;border-radius:6px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-pack:center;justify-content:center;margin:0 2px;padding:8px;border:1px solid #7892a1}.rating-scale .nodes .node .icon{color:#6e7280;font-size:1rem}.rating-scale .nodes .node .label{color:#212533;font-size:.875rem;font-weight:400;line-height:150%}.rating-scale .nodes .node .icon,.rating-scale .nodes .node .label{margin:6px}.rating-scale .nodes .node--selected{background-color:#d5e8ec;border-color:#428bca;color:#428bca}.rating-scale .nodes .node:first-child{margin-left:0}.rating-scale .nodes .node:last-child{margin-right:0}.rating-scale .labels{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px 0}.rating-scale .labels span{color:#080808;font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:400;line-height:150%}.rating-scale--disabled{opacity:.5}.rating-scale:not(.rating-scale--disabled) .node{cursor:pointer}.rating-scale:not(.rating-scale--disabled) .node:hover{background-color:#dedce5}.rating-scale:not(.rating-scale--disabled) .node:focus{border-width:2px;outline:0}"]
14432
- })
14433
- ], RatingScaleComponent);
14434
-
14435
- let RatingScaleModule = class RatingScaleModule {
14436
- };
14437
- RatingScaleModule = __decorate([
14438
- NgModule({
14439
- imports: [
14440
- CommonModule,
14441
- ReactiveFormsModule,
14442
- ],
14443
- declarations: [RatingScaleComponent],
14444
- exports: [RatingScaleComponent],
14755
+ selector: "s-object-card-field",
14756
+ template: "<ng-template>\n <div class=\"container\">\n <ng-content select=\"s-thumbnail\"></ng-content>\n <s-thumbnail\n [id]=\"id + '-thumbnail'\"\n *ngIf=\"!thumbnailComponent && (imageSource || iconClass)\"\n [imageSource]=\"imageSource\"\n [imageAlt]=\"imageAlt || label\"\n [iconClass]=\"iconClass\"\n size=\"small\"\n ></s-thumbnail>\n\n <div class=\"info-container\">\n <div #labelTemplate><ng-content select=\"[labelTemplate]\"></ng-content></div>\n <span\n [id]=\"id + '-label'\"\n *ngIf=\"!labelTemplate.children.length\"\n class=\"label\"\n [pTooltip]=\"label\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ label }}</span\n >\n\n <div #descriptionTemplate><ng-content select=\"[descriptionTemplate]\"></ng-content></div>\n <span\n [id]=\"id + '-description'\"\n *ngIf=\"!descriptionTemplate.children.length\"\n class=\"description\"\n [pTooltip]=\"description\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ description }}</span\n >\n\n <s-button\n [id]=\"id + '-button'\"\n *ngIf=\"buttonLabel\"\n styleClass=\"object-card-button\"\n priority=\"link\"\n [label]=\"buttonLabel\"\n [model]=\"buttonModel\"\n size=\"small\"\n (onClick)=\"buttonClick.emit($event)\"\n ></s-button>\n </div>\n </div>\n</ng-template>\n",
14757
+ styles: [".container{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;height:100%}.info-container{margin-left:10px}.info-container,.info-container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.info-container .label{color:#999;display:block}.info-container .description{display:block}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.info-container{-ms-flex:1;flex:1}}@media (max-width:767px){.info-container,.info-container span{white-space:normal}}.info-container:only-child{margin-left:0}"]
14445
14758
  })
14446
- ], RatingScaleModule);
14759
+ ], ObjectCardFieldComponent);
14447
14760
 
14448
- var SelectButtonComponent_1;
14449
- let SelectButtonComponent = SelectButtonComponent_1 = class SelectButtonComponent {
14761
+ var ObjectCardMainComponent_1;
14762
+ let ObjectCardMainComponent = ObjectCardMainComponent_1 = class ObjectCardMainComponent {
14450
14763
  constructor() {
14451
- this.multiple = false;
14452
- this.itemSelected = new EventEmitter();
14453
- this.itemClicked = new EventEmitter();
14454
- this.disabled = false;
14455
- this.activeItems = new Set();
14456
- }
14457
- writeValue(value) {
14458
- if (!value)
14459
- return;
14460
- this.activeItems.clear();
14461
- if (Array.isArray(value)) {
14462
- value.forEach((item) => {
14463
- this.items.forEach((iItem) => {
14464
- if (this._compareItems(item, iItem)) {
14465
- this.activeItems.add(iItem);
14466
- }
14467
- });
14468
- });
14469
- }
14470
- else {
14471
- this.items.forEach((iItem) => {
14472
- if (this._compareItems(value, iItem)) {
14473
- this.activeItems.add(iItem);
14474
- }
14475
- });
14476
- }
14764
+ this.id = `s-object-card-main-${ObjectCardMainComponent_1.nextId++}`;
14765
+ this.iconClass = "fa fa-picture-o";
14766
+ this.hasThumbnail = true;
14767
+ this.hasDescription = true;
14768
+ this.isBrand = false;
14769
+ this.buttonClick = new EventEmitter();
14770
+ this._thumbnailSize = ThumbnailSize.Medium;
14477
14771
  }
14478
- registerOnChange(onChange) {
14479
- this.onChange = onChange;
14772
+ set thumbnailSize(value) {
14773
+ this._thumbnailSize = value;
14774
+ if (this.thumbnailComponent)
14775
+ this.thumbnailComponent.size = value;
14480
14776
  }
14481
- registerOnTouched(onTouched) {
14482
- this.onTouched = onTouched;
14777
+ get thumbnailSize() {
14778
+ return this._thumbnailSize;
14483
14779
  }
14484
- setDisabledState(disabled) {
14485
- this.disabled = disabled;
14780
+ onResize() {
14781
+ this.update();
14486
14782
  }
14487
- onItemSelect(item) {
14488
- var _a, _b;
14489
- if (this.disabled || item.disabled)
14490
- return;
14491
- this.itemClicked.emit(item);
14492
- if (!this.multiple) {
14493
- this.activeItems.clear();
14494
- }
14495
- this.activeItems.add(item);
14496
- this.itemSelected.emit([...this.activeItems]);
14497
- (_a = this.onChange) === null || _a === void 0 ? void 0 : _a.call(this, [...this.activeItems]);
14498
- (_b = this.onTouched) === null || _b === void 0 ? void 0 : _b.call(this, [...this.activeItems]);
14783
+ ngAfterContentInit() {
14784
+ this.update();
14499
14785
  }
14500
- _compareItems(item1, item2) {
14501
- const _compare = (a, b) => {
14502
- if (a === b) {
14503
- return true;
14504
- }
14505
- if (a === undefined || b === undefined || typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
14506
- return false;
14507
- }
14508
- if (Array.isArray(a) !== Array.isArray(b)) {
14509
- return false;
14510
- }
14511
- let keysA = Object.keys(a);
14512
- let keysB = Object.keys(b);
14513
- if (keysA.length !== keysB.length) {
14514
- return false;
14515
- }
14516
- for (let key of keysA) {
14517
- if (!keysB.includes(key) || !_compare(a[key], b[key])) {
14518
- return false;
14519
- }
14520
- }
14521
- for (let key in a) {
14522
- if (a.hasOwnProperty(key) !== b.hasOwnProperty(key)) {
14523
- return false;
14524
- }
14525
- }
14526
- return true;
14527
- };
14528
- return _compare(item1, item2);
14786
+ update() {
14787
+ const windowWidth = window.innerWidth;
14788
+ if (windowWidth <= Breakpoints.SM_MAX)
14789
+ this.thumbnailSize = ThumbnailSize.Small;
14790
+ else
14791
+ this.thumbnailSize = ThumbnailSize.Medium;
14529
14792
  }
14530
14793
  };
14794
+ ObjectCardMainComponent.nextId = 0;
14531
14795
  __decorate([
14532
14796
  Input()
14533
- ], SelectButtonComponent.prototype, "items", void 0);
14797
+ ], ObjectCardMainComponent.prototype, "id", void 0);
14534
14798
  __decorate([
14535
14799
  Input()
14536
- ], SelectButtonComponent.prototype, "multiple", void 0);
14800
+ ], ObjectCardMainComponent.prototype, "imageSource", void 0);
14537
14801
  __decorate([
14538
- Output()
14539
- ], SelectButtonComponent.prototype, "itemSelected", void 0);
14802
+ Input()
14803
+ ], ObjectCardMainComponent.prototype, "imageFallback", void 0);
14540
14804
  __decorate([
14541
- Output()
14542
- ], SelectButtonComponent.prototype, "itemClicked", void 0);
14543
- SelectButtonComponent = SelectButtonComponent_1 = __decorate([
14544
- Component({
14545
- selector: "s-select-button",
14546
- template: "<div\n class=\"select-button\"\n [ngClass]=\"{ 'select-button--disabled': disabled }\">\n <s-select-button-item\n *ngFor=\"let item of items; index as i\"\n [label]=\"item.label\"\n [active]=\"activeItems?.has(item)\"\n [disabled]=\"disabled || item.disabled\"\n [first]=\"i === 0\"\n [last]=\"i === items.length - 1\"\n (click)=\"onItemSelect(item)\">\n </s-select-button-item>\n</div>",
14547
- providers: [
14548
- {
14549
- provide: NG_VALUE_ACCESSOR,
14550
- useExisting: forwardRef(() => SelectButtonComponent_1),
14551
- multi: true,
14552
- },
14553
- ],
14554
- styles: [".select-button{overflow:hidden}"]
14555
- })
14556
- ], SelectButtonComponent);
14557
-
14558
- let SelectButtonItemComponent = class SelectButtonItemComponent {
14559
- constructor() {
14560
- this.active = false;
14561
- this.first = false;
14562
- this.last = false;
14563
- this.disabled = false;
14564
- }
14565
- };
14805
+ Input()
14806
+ ], ObjectCardMainComponent.prototype, "imageAlt", void 0);
14566
14807
  __decorate([
14567
14808
  Input()
14568
- ], SelectButtonItemComponent.prototype, "label", void 0);
14809
+ ], ObjectCardMainComponent.prototype, "iconClass", void 0);
14569
14810
  __decorate([
14570
14811
  Input()
14571
- ], SelectButtonItemComponent.prototype, "active", void 0);
14812
+ ], ObjectCardMainComponent.prototype, "hasThumbnail", void 0);
14572
14813
  __decorate([
14573
14814
  Input()
14574
- ], SelectButtonItemComponent.prototype, "first", void 0);
14815
+ ], ObjectCardMainComponent.prototype, "hasDescription", void 0);
14575
14816
  __decorate([
14576
14817
  Input()
14577
- ], SelectButtonItemComponent.prototype, "last", void 0);
14818
+ ], ObjectCardMainComponent.prototype, "isBrand", void 0);
14578
14819
  __decorate([
14579
14820
  Input()
14580
- ], SelectButtonItemComponent.prototype, "disabled", void 0);
14581
- SelectButtonItemComponent = __decorate([
14821
+ ], ObjectCardMainComponent.prototype, "label", void 0);
14822
+ __decorate([
14823
+ Input()
14824
+ ], ObjectCardMainComponent.prototype, "description", void 0);
14825
+ __decorate([
14826
+ Input()
14827
+ ], ObjectCardMainComponent.prototype, "buttonLabel", void 0);
14828
+ __decorate([
14829
+ Input()
14830
+ ], ObjectCardMainComponent.prototype, "buttonModel", void 0);
14831
+ __decorate([
14832
+ Output()
14833
+ ], ObjectCardMainComponent.prototype, "buttonClick", void 0);
14834
+ __decorate([
14835
+ ContentChild(ThumbnailComponent, { static: true })
14836
+ ], ObjectCardMainComponent.prototype, "thumbnailComponent", void 0);
14837
+ __decorate([
14838
+ HostListener("window:resize")
14839
+ ], ObjectCardMainComponent.prototype, "onResize", null);
14840
+ ObjectCardMainComponent = ObjectCardMainComponent_1 = __decorate([
14582
14841
  Component({
14583
- selector: "s-select-button-item",
14584
- template: "<button\n class=\"select-button-item\"\n [ngClass]=\"{\n 'select-button-item--active': active,\n 'select-button-item--disabled': disabled,\n 'select-button-item--first': first,\n 'select-button-item--last': last\n }\">\n <span class=\"select-button-item__label\">{{ label }}</span>\n</button>",
14585
- styles: [".select-button-item{padding:8px 12px;cursor:pointer;background-color:#fff;border:none;border-left:1px solid #c1c1cc;border-top:1px solid #c1c1cc;border-bottom:1px solid #c1c1cc}.select-button-item__label{font-family:\"Open Sans\" sans-serif;font-size:14px}.select-button-item:not(.select-button-item--disabled):not(.select-button-item--active):hover{background-color:#eeebf2}.select-button-item--active,.select-button-item--active:hover{background-color:#c1c1cc;font-weight:700}.select-button-item--disabled{opacity:.5;cursor:default}.select-button-item--first{border-top-left-radius:2px;border-bottom-left-radius:2px}.select-button-item--last{border-right:1px solid #c1c1cc;border-top-right-radius:2px;border-bottom-right-radius:2px}"]
14586
- })
14587
- ], SelectButtonItemComponent);
14588
-
14589
- let SelectButtonModule = class SelectButtonModule {
14590
- };
14591
- SelectButtonModule = __decorate([
14592
- NgModule({
14593
- imports: [CommonModule],
14594
- declarations: [
14595
- SelectButtonComponent,
14596
- SelectButtonItemComponent,
14597
- ],
14598
- exports: [SelectButtonComponent],
14842
+ selector: "s-object-card-main",
14843
+ template: "<ng-container *ngIf=\"hasThumbnail\">\n <ng-content select=\"s-thumbnail\"></ng-content>\n <s-thumbnail\n [id]=\"id + '-thumbnail'\"\n [imageSource]=\"imageSource\"\n [imageFallback]=\"imageFallback\"\n [imageAlt]=\"imageAlt || label\"\n [iconClass]=\"iconClass\"\n [size]=\"thumbnailSize\"\n *ngIf=\"!thumbnailComponent\"\n [isBrand]=\"isBrand\"\n ></s-thumbnail>\n</ng-container>\n\n<ng-container *ngIf=\"hasDescription\">\n <div class=\"info-container\">\n <div #labelTemplate><ng-content select=\"[labelTemplate]\"></ng-content></div>\n <span\n [id]=\"id + '-label'\"\n *ngIf=\"!labelTemplate.children.length\"\n class=\"label\"\n [pTooltip]=\"label\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ label }}</span\n >\n\n <div #descriptionTemplate><ng-content select=\"[descriptionTemplate]\"></ng-content></div>\n <span\n [id]=\"id + '-description'\"\n *ngIf=\"!descriptionTemplate.children.length\"\n class=\"description\"\n [pTooltip]=\"description\"\n tooltipPosition=\"top\"\n showDelay=\"500\"\n >{{ description }}</span\n >\n <s-button\n [id]=\"id + '-button'\"\n *ngIf=\"buttonLabel\"\n styleClass=\"object-card-button\"\n priority=\"link\"\n [label]=\"buttonLabel\"\n [model]=\"buttonModel\"\n size=\"small\"\n (onClick)=\"buttonClick.emit($event)\"\n ></s-button>\n </div>\n</ng-container>\n",
14844
+ styles: [":host{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;min-height:70px}.info-container{margin-left:10px;-ms-flex:1;flex:1}.info-container,.info-container span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.info-container .label{display:block;font-weight:700}.info-container .description{color:#999;display:block}@media (max-width:767px){.info-container,.info-container span{white-space:normal}}"]
14599
14845
  })
14600
- ], SelectButtonModule);
14846
+ ], ObjectCardMainComponent);
14601
14847
 
14602
- var SidebarComponent_1;
14603
- let SidebarComponent = SidebarComponent_1 = class SidebarComponent {
14604
- constructor(focusTrapFactory) {
14605
- this.focusTrapFactory = focusTrapFactory;
14606
- this.id = `s-sidebar-${SidebarComponent_1.nextId++}`;
14607
- this.visible = false;
14608
- this.baseZIndex = 0;
14609
- this.largeSized = false;
14610
- this.visibleChange = new EventEmitter();
14848
+ var EnumSeverity;
14849
+ (function (EnumSeverity) {
14850
+ EnumSeverity["Default"] = "Default";
14851
+ EnumSeverity["Info"] = "Info";
14852
+ EnumSeverity["Warn"] = "Warn";
14853
+ EnumSeverity["Error"] = "Error";
14854
+ EnumSeverity["Success"] = "Success";
14855
+ })(EnumSeverity || (EnumSeverity = {}));
14856
+
14857
+ var ObjectCardComponent_1;
14858
+ const elementResizeDetectorMaker = elementResizeDetectorMaker_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
14859
+ let ObjectCardComponent = ObjectCardComponent_1 = class ObjectCardComponent {
14860
+ constructor(cdr, elementRef) {
14861
+ this.cdr = cdr;
14862
+ this.elementRef = elementRef;
14863
+ this.id = `s-object-card-${ObjectCardComponent_1.nextId++}`;
14864
+ this.expanded = false;
14865
+ this.expandTooltip = "Abrir painel";
14866
+ this.collapseTooltip = "Fechar painel";
14867
+ this.fieldsMinWidth = 200;
14868
+ this.expandedChange = new EventEmitter();
14869
+ this.maxVisibleFields = 0;
14870
+ this.severity = EnumSeverity.Default;
14871
+ this.EnumSeverity = EnumSeverity;
14611
14872
  }
14612
- onShow() {
14613
- DomHandler.addClass(document.body, "ui-overflow-hidden-sidebar");
14614
- const focusTrap = this.focusTrapFactory.create(this.innerSidebar.containerViewChild.nativeElement, false);
14615
- focusTrap.focusInitialElementWhenReady();
14873
+ ngAfterViewInit() {
14874
+ this.update();
14875
+ this.cdr.detectChanges();
14876
+ this.fields.changes.subscribe(() => {
14877
+ this.update();
14878
+ });
14879
+ const erd = elementResizeDetectorMaker({
14880
+ strategy: "scroll",
14881
+ });
14882
+ erd.listenTo(this.elementRef.nativeElement, () => this.update());
14616
14883
  }
14617
- onHide() {
14618
- DomHandler.removeClass(document.body, "ui-overflow-hidden-sidebar");
14884
+ update() {
14885
+ const windowWidth = window.innerWidth;
14886
+ const containerWidth = this.elementRef.nativeElement.offsetWidth;
14887
+ const mainFieldWidth = containerWidth * 0.3 > 260 ? containerWidth * 0.3 : 260;
14888
+ const fieldsMinWidth = this.fieldsMinWidth;
14889
+ const expandIconWidth = 50;
14890
+ const fieldElementList = this.elementRef.nativeElement.getElementsByClassName("s-object-card-field");
14891
+ for (const element of fieldElementList) {
14892
+ element.style.minWidth = `${this.fieldsMinWidth}px`;
14893
+ }
14894
+ let maxFieldQtd;
14895
+ if (windowWidth <= Breakpoints.SM_MAX)
14896
+ maxFieldQtd = 0;
14897
+ else
14898
+ maxFieldQtd = Math.floor((containerWidth - mainFieldWidth) / fieldsMinWidth);
14899
+ if (maxFieldQtd && maxFieldQtd < this.fields.length) {
14900
+ maxFieldQtd = Math.floor((containerWidth - mainFieldWidth - expandIconWidth) / fieldsMinWidth);
14901
+ }
14902
+ this.maxVisibleFields = maxFieldQtd;
14903
+ if (maxFieldQtd >= this.fields.length && this.expanded)
14904
+ this.collapse();
14619
14905
  }
14620
- close(event) {
14621
- DomHandler.removeClass(document.body, "ui-overflow-hidden-sidebar");
14622
- this.visibleChange.emit(false);
14623
- event.preventDefault();
14906
+ toggle() {
14907
+ this.expanded ? this.collapse() : this.expand();
14908
+ }
14909
+ expand() {
14910
+ this.expanded = true;
14911
+ this.expandedChange.emit(this.expanded);
14912
+ }
14913
+ collapse() {
14914
+ this.expanded = false;
14915
+ this.expandedChange.emit(this.expanded);
14916
+ }
14917
+ getExpandedFieldWidth() {
14918
+ const containerWidth = this.elementRef.nativeElement.offsetWidth;
14919
+ let fieldsPerRow;
14920
+ if (containerWidth <= Breakpoints.SM_MAX)
14921
+ fieldsPerRow = 1;
14922
+ else if (containerWidth <= Breakpoints.MD_MAX)
14923
+ fieldsPerRow = 2;
14924
+ else if (containerWidth <= Breakpoints.LG_MAX)
14925
+ fieldsPerRow = 4;
14926
+ else
14927
+ fieldsPerRow = 6;
14928
+ return 12 / fieldsPerRow;
14624
14929
  }
14625
14930
  };
14626
- SidebarComponent.nextId = 0;
14627
- SidebarComponent.ctorParameters = () => [
14628
- { type: FocusTrapFactory }
14931
+ ObjectCardComponent.nextId = 0;
14932
+ ObjectCardComponent.ctorParameters = () => [
14933
+ { type: ChangeDetectorRef },
14934
+ { type: ElementRef }
14629
14935
  ];
14630
14936
  __decorate([
14631
14937
  Input()
14632
- ], SidebarComponent.prototype, "id", void 0);
14938
+ ], ObjectCardComponent.prototype, "id", void 0);
14633
14939
  __decorate([
14634
14940
  Input()
14635
- ], SidebarComponent.prototype, "visible", void 0);
14941
+ ], ObjectCardComponent.prototype, "expanded", void 0);
14636
14942
  __decorate([
14637
14943
  Input()
14638
- ], SidebarComponent.prototype, "header", void 0);
14944
+ ], ObjectCardComponent.prototype, "expandTooltip", void 0);
14639
14945
  __decorate([
14640
14946
  Input()
14641
- ], SidebarComponent.prototype, "baseZIndex", void 0);
14947
+ ], ObjectCardComponent.prototype, "collapseTooltip", void 0);
14642
14948
  __decorate([
14643
14949
  Input()
14644
- ], SidebarComponent.prototype, "largeSized", void 0);
14950
+ ], ObjectCardComponent.prototype, "fieldsMinWidth", void 0);
14645
14951
  __decorate([
14646
14952
  Output()
14647
- ], SidebarComponent.prototype, "visibleChange", void 0);
14953
+ ], ObjectCardComponent.prototype, "expandedChange", void 0);
14648
14954
  __decorate([
14649
- ViewChild(Sidebar, { static: true })
14650
- ], SidebarComponent.prototype, "innerSidebar", void 0);
14955
+ ContentChild(ObjectCardMainComponent, { static: true })
14956
+ ], ObjectCardComponent.prototype, "main", void 0);
14651
14957
  __decorate([
14652
- ContentChild(HeaderComponent, { static: true })
14653
- ], SidebarComponent.prototype, "headerSection", void 0);
14958
+ ContentChildren(ObjectCardFieldComponent, { descendants: true })
14959
+ ], ObjectCardComponent.prototype, "fields", void 0);
14654
14960
  __decorate([
14655
- ContentChild(FooterComponent, { static: true })
14656
- ], SidebarComponent.prototype, "footerSection", void 0);
14657
- SidebarComponent = SidebarComponent_1 = __decorate([
14961
+ Input()
14962
+ ], ObjectCardComponent.prototype, "severity", void 0);
14963
+ __decorate([
14964
+ Input()
14965
+ ], ObjectCardComponent.prototype, "borderButtonOptions", void 0);
14966
+ ObjectCardComponent = ObjectCardComponent_1 = __decorate([
14658
14967
  Component({
14659
- selector: "s-sidebar",
14660
- template: "<p-sidebar\n [id]=\"id\"\n [visible]=\"visible\"\n (visibleChange)=\"visibleChange.emit($event)\"\n [blockScroll]=\"true\"\n [baseZIndex]=\"baseZIndex\"\n [modal]=\"true\"\n [dismissible]=\"false\"\n [showCloseIcon]=\"false\"\n position=\"right\"\n appendTo=\"body\"\n [styleClass]=\"largeSized ? 's-sidebar-panel s-sidebar-panel-lg' : 's-sidebar-panel'\"\n (onShow)=\"onShow()\"\n (onHide)=\"onHide()\">\n <div\n [id]=\"id + '-container'\"\n class=\"s-sidebar-container\">\n <a\n href=\"#\"\n role=\"button\"\n class=\"s-sidebar-close\"\n (click)=\"close($event)\">\n <span\n class=\"fa fa-times\"\n aria-hidden=\"true\">\n </span></a>\n <div\n *ngIf=\"header && !headerSection\" \n [id]=\"id + '-header'\"\n class=\"s-sidebar-header\">\n <h2 class=\"sds-panel-title s-sidebar-header__title\">{{header}}</h2>\n </div>\n <div\n *ngIf=\"headerSection\" \n [id]=\"id + '-header'\"\n class=\"s-sidebar-header\">\n <ng-content select=\"s-header\"></ng-content>\n </div>\n <p-scrollPanel\n [id]=\"id + '-content-container'\"\n class=\"s-sidebar-content-container\"\n styleClass=\"s-sidebar-content\">\n <ng-content></ng-content>\n </p-scrollPanel>\n <div\n *ngIf=\"footerSection\"\n [id]=\"id + '-footer'\"\n class=\"s-sidebar-footer\">\n <ng-content select=\"s-footer\"></ng-content>\n </div>\n </div>\n</p-sidebar>\n",
14661
- encapsulation: ViewEncapsulation.None,
14662
- styles: [".ui-overflow-hidden-sidebar{overflow:hidden}body .ui-sidebar.s-sidebar-panel{width:50%;padding:0}@media (max-width:767px){body .ui-sidebar.s-sidebar-panel{width:100%}}@media (min-width:768px){body .ui-sidebar.s-sidebar-panel{width:75%}}@media (min-width:992px){body .ui-sidebar.s-sidebar-panel{width:50%}body .ui-sidebar.s-sidebar-panel.s-sidebar-panel-lg{width:75%}}body .ui-sidebar.s-sidebar-panel .s-sidebar-container{height:100%;width:100%;padding:20px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:column;flex-direction:column}body .ui-sidebar.s-sidebar-panel .s-sidebar-close{position:absolute;right:20px;top:20px;color:#333}body .ui-sidebar.s-sidebar-panel .s-sidebar-header{border-bottom:1px solid #ccc;padding-bottom:15px;padding-right:20px;margin-bottom:15px;-ms-flex-negative:0;flex-shrink:0}body .ui-sidebar.s-sidebar-panel .s-sidebar-content-container{-ms-flex:1;flex:1;overflow:hidden}body .ui-sidebar.s-sidebar-panel .s-sidebar-content{height:100%}body .ui-sidebar.s-sidebar-panel .s-sidebar-footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;-ms-flex-negative:0;flex-shrink:0}body .ui-sidebar.s-sidebar-panel p-scrollpanel{padding-top:30px}body .ui-sidebar.s-sidebar-panel .s-sidebar-header+p-scrollpanel{padding-top:0}p-scrollPanel{display:block}.s-sidebar-header__title{font-weight:400}"]
14968
+ selector: "s-object-card",
14969
+ template: "<div [id]=\"id\" class=\"container\">\n <s-border-button\n *ngIf=\"\n borderButtonOptions?.visible\n ? borderButtonOptions?.visible(severity)\n : false\n \"\n [severity]=\"severity\"\n [options]=\"borderButtonOptions\"\n class=\"object-card__border-button\"\n [@BorderButtonAnimation]\n ></s-border-button>\n\n <div\n [id]=\"id + '-main-container'\"\n class=\"main-container\"\n [ngClass]=\"{\n 'with-hidden-fields': fields.length > maxVisibleFields,\n 'with-visible-fields': fields.length && maxVisibleFields,\n 'main-container--severity-default': severity === EnumSeverity.Default,\n 'main-container--severity-info': severity === EnumSeverity.Info,\n 'main-container--severity-warn': severity === EnumSeverity.Warn,\n 'main-container--severity-error': severity === EnumSeverity.Error,\n 'main-container--severity-success': severity == EnumSeverity.Success\n }\"\n >\n <div class=\"object-content\">\n <div class=\"s-object-card-main\"><ng-content select=\"s-object-card-main\"></ng-content></div>\n\n <div class=\"divider\" *ngIf=\"maxVisibleFields && fields.length\"></div>\n\n <div *ngFor=\"let field of (fields.toArray() | slice: 0:maxVisibleFields)\" class=\"s-object-card-field\">\n <ng-container *ngTemplateOutlet=\"field.content\"></ng-container>\n </div>\n </div>\n\n <div\n [id]=\"id + '-expand-icon-container'\"\n class=\"expand-icon-container\"\n (click)=\"toggle()\"\n [pTooltip]=\"expanded ? collapseTooltip : expandTooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n >\n <span [id]=\"id + '-expand-icon'\" class=\"expand-icon fa\" [ngClass]=\"{ 'fa-minus': expanded, 'fa-plus': !expanded }\"></span>\n </div>\n </div>\n\n <div\n [id]=\"id + '-expandable-container'\"\n [@expandableContent]=\"expanded\"\n class=\"expandable-container\"\n [ngClass]=\"{\n 'expandable-container--severity-default':\n severity === EnumSeverity.Default,\n 'expandable-container--severity-info': severity === EnumSeverity.Info,\n 'expandable-container--severity-warn': severity === EnumSeverity.Warn,\n 'expandable-container--severity-error': severity === EnumSeverity.Error,\n 'expandable-container--severity-success':\n severity == EnumSeverity.Success\n }\"\n >\n <div class=\"ui-g ui-g-12\">\n <ng-container\n *ngFor=\"\n let field of fields.toArray()\n | slice : maxVisibleFields : fields.length\n \"\n >\n <div class=\"ui-g-{{ getExpandedFieldWidth() }}\">\n <div class=\"s-object-card-field\">\n <ng-container\n *ngTemplateOutlet=\"field.content\"\n ></ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n</div>\n",
14970
+ animations: [
14971
+ trigger("expandableContent", [
14972
+ state("*", style$7({
14973
+ height: "0",
14974
+ })),
14975
+ state("false", style$7({
14976
+ height: "0",
14977
+ })),
14978
+ state("true", style$7({
14979
+ height: "*",
14980
+ })),
14981
+ transition("* => true", animate("200ms ease-out")),
14982
+ transition("false <=> true", animate("200ms ease-out")),
14983
+ ]),
14984
+ trigger("BorderButtonAnimation", [
14985
+ transition(":enter", [
14986
+ style$7({ transform: "scaleY(0)", opacity: 0 }),
14987
+ animate("300ms ease", style$7({ transform: "scaleY(1)", opacity: 1 })),
14988
+ ]),
14989
+ transition(":leave", [
14990
+ style$7({ transform: "scaleY(1)", opacity: 1 }),
14991
+ animate("300ms ease", style$7({ transform: "scaleY(0)", opacity: 0 })),
14992
+ ]),
14993
+ ]),
14994
+ ],
14995
+ styles: [":host{display:block}.container{margin-bottom:20px;position:relative}.main-container{display:-ms-flexbox;display:flex}.expandable-container,.main-container{background-color:#fff;border:1px solid #ccc;position:relative;overflow:hidden;width:100%}.expandable-container--severity-default{border-color:#ccc;border-top:initial}.expandable-container--severity-info{transition:border-color .5s;border-color:#428bca;border-top:initial}.expandable-container--severity-warn{transition:border-color .5s;border-color:#f8931f;border-top:initial}.expandable-container--severity-error{transition:border-color .5s;border-color:#c13018;border-top:initial}.expandable-container--severity-success{transition:border-color .5s;border-color:#0c9348;border-top:initial}.main-container--severity-default{border-color:#ccc}.main-container--severity-info{transition:border-color .5s;border-color:#428bca}.main-container--severity-warn{transition:border-color .5s;border-color:#f8931f}.main-container--severity-error{transition:border-color .5s;border-color:#c13018}.main-container--severity-success{transition:border-color .5s;border-color:#0c9348}.object-card__border-button{position:absolute;top:-13px;right:15px;z-index:1}.expandable-container{border-top:none;box-shadow:inset 0 6px 4px -4px #ddd;margin-top:-1px}.expand-icon-container{display:none;text-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;width:25px;position:absolute;right:15px;height:25px;top:calc(50% - 12px)}.expand-icon{-ms-flex:1;flex:1}.object-content{display:-ms-flexbox;display:flex;width:100%}.s-object-card-main{-ms-flex-negative:0;flex-shrink:0;-ms-flex-positive:1;flex-grow:1;overflow:hidden;padding:15px}.main-container.with-visible-fields .s-object-card-main{max-width:30%}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.main-container.with-visible-fields .s-object-card-main{width:20%}}.s-object-card-field{overflow:hidden;height:100%}.main-container .s-object-card-field{padding:15px}.main-container .divider{width:1px;-ms-flex-negative:0;flex-shrink:0;background-color:#ccc;margin:15px -1px 15px 0}.main-container.with-hidden-fields .object-content{width:calc(100% - 35px)}.main-container.with-hidden-fields .expand-icon-container{display:-ms-flexbox;display:flex}::ng-deep .object-card-button{padding-left:0!important;padding-right:10px!important;border:none!important;height:auto!important;min-width:auto!important;text-align:left!important}@media (max-width:767px){.s-object-card-main{max-width:calc(100% - 50px)}}"]
14663
14996
  })
14664
- ], SidebarComponent);
14997
+ ], ObjectCardComponent);
14665
14998
 
14666
- let SidebarModule = class SidebarModule {
14999
+ let BorderButtonComponent = class BorderButtonComponent {
15000
+ constructor() {
15001
+ this.severity = EnumSeverity.Default;
15002
+ this.EnumSeverity = EnumSeverity;
15003
+ this.TooltipPosition = TooltipPosition;
15004
+ }
14667
15005
  };
14668
- SidebarModule = __decorate([
15006
+ __decorate([
15007
+ Input()
15008
+ ], BorderButtonComponent.prototype, "severity", void 0);
15009
+ __decorate([
15010
+ Input()
15011
+ ], BorderButtonComponent.prototype, "options", void 0);
15012
+ BorderButtonComponent = __decorate([
15013
+ Component({
15014
+ selector: "s-border-button",
15015
+ template: "<button\n class=\"border-button\"\n [ngClass]=\"{\n 'border-button--severity-default': severity === EnumSeverity.Default,\n 'border-button--severity-info': severity === EnumSeverity.Info,\n 'border-button--severity-warn': severity === EnumSeverity.Warn,\n 'border-button--severity-error': severity === EnumSeverity.Error,\n 'border-button--severity-success': severity == EnumSeverity.Success,\n 'border-button--disabled': options?.disabled\n ? options?.disabled(severity)\n : false\n }\"\n (click)=\"options?.onClick ? options?.onClick(severity) : null\"\n [sTooltip]=\"options?.tooltip ? options?.tooltip(severity) : null\"\n [tooltipPosition]=\"TooltipPosition.Left\"\n [disabled]=\"options?.disabled ? options?.disabled(severity) : false\"\n>\n <span class=\"border-button__label\">\n {{ options?.label ? options?.label(severity) : null }}\n </span>\n <span\n *ngIf=\"options?.icon ? options?.icon(severity) : false\"\n class=\"border-button__icon {{ options?.icon(severity) }}\"\n ></span>\n</button>",
15016
+ styles: [".border-button{padding:0 8px;border:1px solid;border-radius:12px;height:23px;max-width:320px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.border-button__label{font-family:Open Sans,sans-serif;font-size:12px;line-height:150%;width:100%;display:block;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.border-button__icon{font-size:12px;color:#333;margin-left:8px}.border-button--severity-default{border-color:#ccc;background-color:#fff}.border-button--severity-info{border-color:#428bca;background-color:#d5e8ec;transition:background-color .5s,border-color .5s}.border-button--severity-info:enabled:hover{background-color:#9ecad4;cursor:pointer}.border-button--severity-info:enabled:active{transition:none;background-color:#67acbc;border-color:#67acbc}.border-button--severity-warn{border-color:#f8931f;background-color:#fce3ba;transition:background-color .5s,border-color .5s}.border-button--severity-warn:enabled:hover{background-color:#f8bf5e;cursor:pointer}.border-button--severity-warn:enabled:active{transition:none;background-color:#f5a319;border-color:#f5a319}.border-button--severity-error{border-color:#c13018;background-color:#fcd2d2;transition:background-color .5s,border-color .5s}.border-button--severity-error:enabled:hover{background-color:#f89696;cursor:pointer}.border-button--severity-error:enabled:active{transition:none;background-color:#f45b5b;border-color:#f45b5b}.border-button--severity-success{border-color:#0c9348;background-color:#e6ffb3;transition:background-color .5s,border-color .5s}.border-button--severity-success:enabled:hover{background-color:#c8ff5c;cursor:pointer}.border-button--severity-success:enabled:active{transition:none;background-color:#ade500;border-color:#ade500}.border-button--disabled:disabled:hover{cursor:default}"]
15017
+ })
15018
+ ], BorderButtonComponent);
15019
+
15020
+ let BorderButtonModule = class BorderButtonModule {
15021
+ };
15022
+ BorderButtonModule = __decorate([
14669
15023
  NgModule({
14670
- imports: [CommonModule, A11yModule, SidebarModule$1, ScrollPanelModule, StructureModule],
14671
- declarations: [SidebarComponent],
14672
- exports: [StructureModule, SidebarComponent],
15024
+ imports: [CommonModule, TooltipModule],
15025
+ declarations: [BorderButtonComponent],
15026
+ exports: [BorderButtonComponent]
14673
15027
  })
14674
- ], SidebarModule);
15028
+ ], BorderButtonModule);
14675
15029
 
14676
- let SlidePanelService = class SlidePanelService {
15030
+ let ObjectCardModule = class ObjectCardModule {
15031
+ };
15032
+ ObjectCardModule = __decorate([
15033
+ NgModule({
15034
+ imports: [CommonModule, TooltipModule$1, ThumbnailModule, ButtonModule, BorderButtonModule],
15035
+ declarations: [ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
15036
+ exports: [ThumbnailModule, ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
15037
+ })
15038
+ ], ObjectCardModule);
15039
+
15040
+ var ProductHeaderComponent_1;
15041
+ let ProductHeaderComponent = ProductHeaderComponent_1 = class ProductHeaderComponent {
14677
15042
  constructor() {
14678
- this.modalCloseMap = new Map();
14679
- }
14680
- createSlidePanel(id) {
14681
- const panelSubject = new Subject();
14682
- this.modalCloseMap.set(id, panelSubject);
14683
- return panelSubject.asObservable();
14684
- }
14685
- getModalCloseObservable(id) {
14686
- return this.modalCloseMap.get(id).asObservable();
15043
+ this.id = `s-product-header-${ProductHeaderComponent_1.nextId++}`;
15044
+ this.baseZIndex = 0;
15045
+ this.isHeaderFrame = true;
14687
15046
  }
14688
- closeModal(id) {
14689
- const subject = this.modalCloseMap.get(id);
14690
- if (subject) {
14691
- subject.next();
15047
+ ngAfterViewInit() {
15048
+ this.container.nativeElement.style.zIndex = String(this.baseZIndex + ++DomHandler.zindex);
15049
+ if (this.isHeaderFrame) {
15050
+ this.container.nativeElement.style.borderBottom = "1px solid $default-secondary-color";
15051
+ }
15052
+ else {
15053
+ this.container.nativeElement.style.borderTop = "1px solid $default-secondary-color";
14692
15054
  }
14693
15055
  }
14694
15056
  };
14695
- SlidePanelService = __decorate([
14696
- Injectable()
14697
- ], SlidePanelService);
14698
-
14699
- var SlidePanelComponent_1;
14700
- const SMALL_DEVICE_BREAKPOINT = 420;
14701
- let SlidePanelComponent = SlidePanelComponent_1 = class SlidePanelComponent {
14702
- constructor(slidePanelService) {
14703
- this.slidePanelService = slidePanelService;
14704
- this.id = `slide-panel-${++SlidePanelComponent_1.nextId}`;
14705
- this.openIcon = "fas fa-chevron-right";
14706
- this.closeIcon = "fas fa-chevron-left";
14707
- this.cache = false;
14708
- this.createOpen = false;
14709
- this.panelOpened = new EventEmitter();
14710
- this.panelClosed = new EventEmitter();
14711
- this.isOpen = false;
14712
- this.isSlideOver = false;
14713
- this.isAnimating = false;
14714
- this.isContentAnimationDisabled = true;
14715
- this.slideHeight = 0;
14716
- this.sideContentWidth = 0;
14717
- this._unsubscribe$ = new Subject();
14718
- }
14719
- onResize() {
14720
- this._checkOverBehavior();
15057
+ ProductHeaderComponent.nextId = 0;
15058
+ __decorate([
15059
+ Input()
15060
+ ], ProductHeaderComponent.prototype, "id", void 0);
15061
+ __decorate([
15062
+ Input()
15063
+ ], ProductHeaderComponent.prototype, "header", void 0);
15064
+ __decorate([
15065
+ Input()
15066
+ ], ProductHeaderComponent.prototype, "baseZIndex", void 0);
15067
+ __decorate([
15068
+ Input()
15069
+ ], ProductHeaderComponent.prototype, "isHeaderFrame", void 0);
15070
+ __decorate([
15071
+ ViewChild("headerContainer", { static: false })
15072
+ ], ProductHeaderComponent.prototype, "container", void 0);
15073
+ ProductHeaderComponent = ProductHeaderComponent_1 = __decorate([
15074
+ Component({
15075
+ selector: "s-product-header",
15076
+ template: "<div [id]=\"id\" class=\"box\">\n <div\n #headerContainer\n class=\"sds-container\"\n [class]=\"isHeaderFrame ? 'header-frame' : 'primary-header'\"\n >\n <h1 [class]=\"isHeaderFrame ? 'title' : 'primary-title'\">{{ header }}</h1>\n <div class=\"content\">\n <ng-content></ng-content>\n </div>\n </div>\n </div>\n",
15077
+ styles: [".box{position:relative;width:100%;height:70px}.header-frame{padding-top:15px;padding-bottom:15px;width:100%;top:0;left:0;height:70px;background-color:#fff;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;position:fixed}.title{color:#999;font-weight:400;font-size:16pt;margin-right:15px;min-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{display:-ms-flexbox;display:flex;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.primary-header{display:-ms-flexbox;display:flex;width:100%;height:70px;padding:15px 20px;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;border-bottom:1px solid #ddd;background-color:#fff;gap:24px}@media (max-width:768px){.primary-header{width:100%}}.primary-header .primary-title{color:#999;font-weight:400;font-size:16pt;margin-right:15px;min-width:140px;overflow:hidden;text-overflow:ellipsis}"]
15078
+ })
15079
+ ], ProductHeaderComponent);
15080
+
15081
+ let ProductHeaderModule = class ProductHeaderModule {
15082
+ };
15083
+ ProductHeaderModule = __decorate([
15084
+ NgModule({
15085
+ imports: [CommonModule, TooltipModule$1, ThumbnailModule],
15086
+ declarations: [ProductHeaderComponent],
15087
+ exports: [ProductHeaderComponent, ThumbnailModule],
15088
+ })
15089
+ ], ProductHeaderModule);
15090
+
15091
+ var ProgressBarColors;
15092
+ (function (ProgressBarColors) {
15093
+ ProgressBarColors["Blue"] = "blue";
15094
+ ProgressBarColors["Green"] = "green";
15095
+ ProgressBarColors["Red"] = "red";
15096
+ ProgressBarColors["Yellow"] = "yellow";
15097
+ })(ProgressBarColors || (ProgressBarColors = {}));
15098
+
15099
+ var ProgressBarMode;
15100
+ (function (ProgressBarMode) {
15101
+ ProgressBarMode["Determinate"] = "determinate";
15102
+ ProgressBarMode["Indeterminate"] = "indeterminate";
15103
+ })(ProgressBarMode || (ProgressBarMode = {}));
15104
+
15105
+ let ProgressBarComponent = class ProgressBarComponent {
15106
+ constructor() {
15107
+ this.numberFormatOptions = {
15108
+ style: "decimal",
15109
+ minimumFractionDigits: 0,
15110
+ maximumFractionDigits: 2,
15111
+ };
15112
+ this.showValue = true;
15113
+ this.mode = ProgressBarMode.Determinate;
14721
15114
  }
14722
15115
  ngOnInit() {
14723
- this._checkOverBehavior();
14724
- this.slidePanelService.createSlidePanel(this.id)
14725
- .pipe(takeUntil(this._unsubscribe$))
14726
- .subscribe(() => {
14727
- this.isOpen = false;
14728
- });
14729
- }
14730
- ngAfterViewInit() {
14731
- queueMicrotask(() => {
14732
- if (this.createOpen) {
14733
- this.isOpen = true;
14734
- }
14735
- });
14736
- }
14737
- ngAfterViewChecked() {
14738
- // to executed at a safe time prior to control returning to the browser's event loop
14739
- queueMicrotask(() => {
14740
- this._calculateSlideHeight();
14741
- this._calculateSideContentWidth();
14742
- this.isContentAnimationDisabled = false;
14743
- });
14744
- }
14745
- ngOnDestroy() {
14746
- this._unsubscribe$.next();
14747
- this._unsubscribe$.complete();
15116
+ this.validateInputs();
14748
15117
  }
14749
- onClickButton() {
14750
- if (this.isAnimating) {
14751
- return;
15118
+ validateInputs() {
15119
+ if (this.value < 0 || this.value > 100) {
15120
+ throw new Error("Invalid value for value");
14752
15121
  }
14753
- this.isOpen = !this.isOpen;
14754
- if (this.isOpen) {
14755
- this.panelOpened.emit();
15122
+ if (this.targetValue < 0 || this.targetValue > 100) {
15123
+ throw new Error("Invalid value for targetValue");
14756
15124
  }
14757
- else {
14758
- this.panelClosed.emit();
15125
+ if (this.mode === ProgressBarMode.Indeterminate && (this.value || this.targetValue || this.targetLabel)) {
15126
+ throw new Error("When the mode is indeterminate, the value, targetValue and targetLabel parameters are not expected.");
14759
15127
  }
14760
15128
  }
14761
- onContentAnimationStart() {
14762
- this.isAnimating = true;
14763
- }
14764
- onContentAnimationDone() {
14765
- this.isAnimating = false;
14766
- this._calculateSideContentWidth();
14767
- }
14768
- _checkOverBehavior() {
14769
- this.isSlideOver = window.innerWidth <= SMALL_DEVICE_BREAKPOINT;
14770
- }
14771
- _calculateSlideHeight() {
14772
- this.slideHeight = this._sideContentRef.nativeElement.clientHeight;
14773
- }
14774
- _calculateSideContentWidth() {
14775
- const slidePanelWidth = this._slidePanelRef.nativeElement.getBoundingClientRect().width;
14776
- const slideContentWidth = this._slideContentRef.nativeElement.getBoundingClientRect().width;
14777
- this.sideContentWidth = slidePanelWidth - slideContentWidth;
14778
- }
14779
15129
  };
14780
- SlidePanelComponent.nextId = 0;
14781
- SlidePanelComponent.ctorParameters = () => [
14782
- { type: SlidePanelService }
14783
- ];
14784
15130
  __decorate([
14785
15131
  Input()
14786
- ], SlidePanelComponent.prototype, "id", void 0);
15132
+ ], ProgressBarComponent.prototype, "value", void 0);
14787
15133
  __decorate([
14788
15134
  Input()
14789
- ], SlidePanelComponent.prototype, "openIcon", void 0);
15135
+ ], ProgressBarComponent.prototype, "numberFormatOptions", void 0);
14790
15136
  __decorate([
14791
15137
  Input()
14792
- ], SlidePanelComponent.prototype, "closeIcon", void 0);
15138
+ ], ProgressBarComponent.prototype, "targetValue", void 0);
14793
15139
  __decorate([
14794
15140
  Input()
14795
- ], SlidePanelComponent.prototype, "cache", void 0);
15141
+ ], ProgressBarComponent.prototype, "label", void 0);
14796
15142
  __decorate([
14797
15143
  Input()
14798
- ], SlidePanelComponent.prototype, "createOpen", void 0);
14799
- __decorate([
14800
- Output()
14801
- ], SlidePanelComponent.prototype, "panelOpened", void 0);
14802
- __decorate([
14803
- Output()
14804
- ], SlidePanelComponent.prototype, "panelClosed", void 0);
14805
- __decorate([
14806
- ViewChild("slidePanel")
14807
- ], SlidePanelComponent.prototype, "_slidePanelRef", void 0);
15144
+ ], ProgressBarComponent.prototype, "targetLabel", void 0);
14808
15145
  __decorate([
14809
- ViewChild("slideContent")
14810
- ], SlidePanelComponent.prototype, "_slideContentRef", void 0);
15146
+ Input()
15147
+ ], ProgressBarComponent.prototype, "activeColor", void 0);
14811
15148
  __decorate([
14812
- ViewChild("sideContent")
14813
- ], SlidePanelComponent.prototype, "_sideContentRef", void 0);
15149
+ Input()
15150
+ ], ProgressBarComponent.prototype, "showValue", void 0);
14814
15151
  __decorate([
14815
- HostListener("window:resize")
14816
- ], SlidePanelComponent.prototype, "onResize", null);
14817
- SlidePanelComponent = SlidePanelComponent_1 = __decorate([
15152
+ Input()
15153
+ ], ProgressBarComponent.prototype, "mode", void 0);
15154
+ ProgressBarComponent = __decorate([
14818
15155
  Component({
14819
- selector: "s-slide-panel",
14820
- template: "<div #slidePanel class=\"slide-panel\">\n <div\n #slideContent\n class=\"slide-content\"\n [ngClass]=\"{\n 'slide-content--closed': !isOpen,\n 'slide-content--over': isSlideOver\n }\">\n <div\n #mainContainer\n class=\"main-container\"\n [style.maxHeight]=\"slideHeight + 'px'\">\n <ng-container *ngIf=\"cache; then cacheTemplate else cachelessTemplate\"></ng-container>\n </div>\n <button\n class=\"button\"\n [ngClass]=\"isOpen ? closeIcon : openIcon\"\n (click)=\"onClickButton()\">\n </button>\n </div>\n <div \n #sideContent\n class=\"side-content\"\n [ngStyle]=\"{ 'width.px': sideContentWidth }\">\n <ng-content select=\"[side-content]\"></ng-content>\n </div>\n</div>\n\n<ng-template #cacheTemplate>\n <div\n class=\"content-container\"\n [@cacheAnimation]=\"isOpen\"\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cacheAnimation.start)=\"onContentAnimationStart()\"\n (@cacheAnimation.done)=\"onContentAnimationDone()\">\n <ng-container [ngTemplateOutlet]=\"slideContentTemplate\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #cachelessTemplate>\n <div\n *ngIf=\"isOpen\"\n class=\"content-container\"\n @cachelessAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cachelessAnimation.start)=\"onContentAnimationStart()\"\n (@cachelessAnimation.done)=\"onContentAnimationDone()\">\n <ng-container [ngTemplateOutlet]=\"slideContentTemplate\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #slideContentTemplate>\n <ng-content select=\"[slide-content]\"></ng-content>\n</ng-template>",
14821
- animations: [
14822
- trigger("cachelessAnimation", [
14823
- transition(":enter", [
14824
- style$7({ width: "0" }),
14825
- animate("200ms linear", style$7({ width: "*" })),
14826
- ]),
14827
- transition(":leave", [
14828
- style$7({ width: "*" }),
14829
- animate("200ms linear", style$7({ width: "0" })),
14830
- ]),
14831
- ]),
14832
- trigger("cacheAnimation", [
14833
- state("true", style$7({ width: "*", padding: '0 16px' })),
14834
- state("false", style$7({ width: '0px', padding: '0' })),
14835
- transition("* => *", animate("200ms")),
14836
- ]),
14837
- ],
14838
- styles: [".slide-panel{display:-ms-flexbox;display:flex;width:100%}.slide-panel .slide-content{display:-ms-flexbox;display:flex;position:relative}.slide-panel .slide-content .main-container{background-color:#eeebf2;display:-ms-flexbox;display:flex;border:1px solid #ccc;overflow:hidden;position:relative}.slide-panel .slide-content .main-container .content-container{overflow-y:auto;overflow-x:hidden;padding:16px}.slide-panel .slide-content .button{-ms-flex-align:center;align-items:center;background-color:#eeebf2;border:1px solid #ccc;border-left:none;border-radius:0 4px 4px 0;cursor:pointer;display:-ms-flexbox;display:flex;font-family:\"Font Awesome 5 Pro\";font-size:16px;height:32px;-ms-flex-pack:center;justify-content:center;position:absolute;right:-32px;top:16px;width:32px;z-index:99}.slide-panel .slide-content--closed .main-container{border:none}.slide-panel .slide-content--over{position:absolute}.slide-panel .side-content{display:-ms-flexbox;display:flex;height:-webkit-max-content;height:max-content;overflow:auto;transition:width .1s linear}"]
14839
- })
14840
- ], SlidePanelComponent);
14841
-
14842
- let SlidePanelModule = class SlidePanelModule {
14843
- };
14844
- SlidePanelModule = __decorate([
14845
- NgModule({
14846
- imports: [CommonModule],
14847
- declarations: [SlidePanelComponent],
14848
- exports: [SlidePanelComponent],
14849
- providers: [SlidePanelService],
15156
+ selector: "s-progressbar",
15157
+ template: "<ng-container *ngIf=\"mode === 'determinate'; then pbDeterminateTemplate else pbIndeterminateTemplate\"></ng-container>\n\n<ng-template #pbDeterminateTemplate>\n <s-progressbar-determinate\n [value]=\"value\"\n [numberFormatOptions]=\"numberFormatOptions\"\n [targetValue]=\"targetValue\"\n [targetLabel]=\"targetLabel\"\n [activeColor]=\"activeColor\"\n [showValue]=\"showValue\">\n </s-progressbar-determinate>\n</ng-template>\n\n<ng-template #pbIndeterminateTemplate>\n <s-progressbar-indeterminate\n [activeColor]=\"activeColor\"\n [label]=\"label\">\n </s-progressbar-indeterminate>\n</ng-template>",
15158
+ styles: [".progress-bar{position:relative}.progress-bar .progress-bar-all{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progress-bar .progress-bar-all .progress-bar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progress-bar .progress-bar-all .progress-bar-active--blue{background-color:#428bca}.progress-bar .progress-bar-all .progress-bar-active--green{background-color:#0c9348}.progress-bar .progress-bar-all .progress-bar-active--red{background-color:#c13018}.progress-bar .progress-bar-all .progress-bar-active--yellow{background-color:#fcbf10}.progress-bar .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progress-bar .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progress-bar .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
14850
15159
  })
14851
- ], SlidePanelModule);
14852
-
14853
- var SplitButtonType;
14854
- (function (SplitButtonType) {
14855
- SplitButtonType["Primary"] = "primary";
14856
- SplitButtonType["Secondary"] = "secondary";
14857
- SplitButtonType["Default"] = "default";
14858
- })(SplitButtonType || (SplitButtonType = {}));
15160
+ ], ProgressBarComponent);
14859
15161
 
14860
- let SplitButtonComponent = class SplitButtonComponent {
14861
- constructor(eRef) {
14862
- this.eRef = eRef;
14863
- this.disabled = false;
14864
- this.type = SplitButtonType.Primary;
14865
- this.buttonClicked = new EventEmitter();
14866
- this.open = false;
15162
+ let ProgressBarDeterminateComponent = class ProgressBarDeterminateComponent {
15163
+ constructor(localeService) {
15164
+ this.localeService = localeService;
15165
+ this.showValue = true;
14867
15166
  }
14868
- onClickout(event) {
14869
- if (!this.eRef.nativeElement.contains(event.target)) {
14870
- this.closeDropdown();
14871
- }
15167
+ ngOnInit() {
15168
+ this.validateValues();
15169
+ this.onGetLocale();
14872
15170
  }
14873
- onButtonClick() {
14874
- if (!this.disabled) {
14875
- this.buttonClicked.emit();
14876
- this.closeDropdown();
14877
- }
15171
+ onGetLocale() {
15172
+ this.localeService.getLocale().subscribe({
15173
+ next: (locale) => {
15174
+ this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", this.numberFormatOptions);
15175
+ },
15176
+ error: () => {
15177
+ this.numberFormat = new Intl.NumberFormat("pt-BR", this.numberFormatOptions);
15178
+ },
15179
+ });
14878
15180
  }
14879
- onDropdownClick() {
14880
- if (!this.disabled) {
14881
- this.open = !this.open;
15181
+ validateValues() {
15182
+ if (this.value < 0 || this.value > 100) {
15183
+ throw new Error("Invalid value for value");
15184
+ }
15185
+ if (this.targetValue < 0 || this.targetValue > 100) {
15186
+ throw new Error("Invalid value for targetValue");
14882
15187
  }
14883
- }
14884
- onOptionClick(option) {
14885
- option.action && option.action();
14886
- this.closeDropdown();
14887
- }
14888
- closeDropdown() {
14889
- this.open = false;
14890
15188
  }
14891
15189
  };
14892
- SplitButtonComponent.ctorParameters = () => [
14893
- { type: ElementRef }
15190
+ ProgressBarDeterminateComponent.ctorParameters = () => [
15191
+ { type: LocaleService }
14894
15192
  ];
14895
15193
  __decorate([
14896
15194
  Input()
14897
- ], SplitButtonComponent.prototype, "disabled", void 0);
15195
+ ], ProgressBarDeterminateComponent.prototype, "value", void 0);
14898
15196
  __decorate([
14899
15197
  Input()
14900
- ], SplitButtonComponent.prototype, "iconClass", void 0);
15198
+ ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
14901
15199
  __decorate([
14902
15200
  Input()
14903
- ], SplitButtonComponent.prototype, "label", void 0);
15201
+ ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
14904
15202
  __decorate([
14905
15203
  Input()
14906
- ], SplitButtonComponent.prototype, "type", void 0);
15204
+ ], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
14907
15205
  __decorate([
14908
15206
  Input()
14909
- ], SplitButtonComponent.prototype, "options", void 0);
15207
+ ], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
14910
15208
  __decorate([
14911
- Output()
14912
- ], SplitButtonComponent.prototype, "buttonClicked", void 0);
15209
+ Input()
15210
+ ], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
15211
+ ProgressBarDeterminateComponent = __decorate([
15212
+ Component({
15213
+ selector: "s-progressbar-determinate",
15214
+ template: "<div class=\"progressbar-determinate\">\n <div class=\"progressbar-container\">\n <div\n class=\"progressbar-active\"\n [ngClass]=\"{\n 'progressbar-active--blue' : activeColor === 'blue',\n 'progressbar-active--green': activeColor === 'green',\n 'progressbar-active--red': activeColor === 'red',\n 'progressbar-active--yellow': activeColor === 'yellow'\n }\"\n [ngStyle]=\"{ 'width': value + '%' }\">\n\n {{ showValue && value ? numberFormat.format(value) + '%' : '' }}\n </div>\n </div>\n <div\n *ngIf=\"targetValue\"\n class=\"target\"\n [ngStyle]=\"{\n 'left': targetValue <= 50 ? targetValue + '%' : 'unset',\n 'right': targetValue > 50 ? 100 - targetValue + '%' : 'unset',\n 'align-items': targetValue > 50 ? 'flex-end' : 'flex-start'\n }\">\n <span class=\"target-line\"></span>\n <span class=\"target-label\">\n {{ targetLabel || numberFormat.format(value) + '%' }}\n </span>\n </div>\n </div>\n",
15215
+ styles: [".progressbar-determinate{position:relative}.progressbar-determinate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;overflow:hidden;width:100%}.progressbar-determinate .progressbar-container .progressbar-active{-ms-flex-align:center;align-items:center;color:#fff;display:-ms-flexbox;display:flex;font-family:\"Open Sans\",sans-serif;font-size:14px;height:100%;-ms-flex-pack:center;justify-content:center;line-height:150%;-webkit-user-select:none;-ms-user-select:none;user-select:none;width:80%}.progressbar-determinate .progressbar-container .progressbar-active--blue{background-color:#428bca}.progressbar-determinate .progressbar-container .progressbar-active--green{background-color:#0c9348}.progressbar-determinate .progressbar-container .progressbar-active--red{background-color:#c13018}.progressbar-determinate .progressbar-container .progressbar-active--yellow{background-color:#fcbf10;color:#212533}.progressbar-determinate .target{-ms-flex-align:start;align-items:flex-start;bottom:-38px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute}.progressbar-determinate .target .target-line{background-color:#333;height:40px;margin:8px 0;width:1px}.progressbar-determinate .target .target-label{background-color:#426e78;border-radius:10px;color:#e5eaea;font-family:\"Open Sans\",sans-serif;font-size:12px;line-height:150%;padding:2px 12px}"]
15216
+ })
15217
+ ], ProgressBarDeterminateComponent);
15218
+
15219
+ let ProgressBarIndeterminateComponent = class ProgressBarIndeterminateComponent {
15220
+ };
14913
15221
  __decorate([
14914
- HostListener("document:click", ["$event"])
14915
- ], SplitButtonComponent.prototype, "onClickout", null);
14916
- SplitButtonComponent = __decorate([
15222
+ Input()
15223
+ ], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
15224
+ __decorate([
15225
+ Input()
15226
+ ], ProgressBarIndeterminateComponent.prototype, "label", void 0);
15227
+ ProgressBarIndeterminateComponent = __decorate([
14917
15228
  Component({
14918
- selector: "s-split-button",
14919
- template: "<div class=\"split-button\" [ngClass]=\"{\n 'split-button--primary': type == 'primary',\n 'split-button--secondary': type == 'secondary',\n 'split-button--default': type == 'default',\n 'split-button--disabled': disabled\n }\">\n <button class=\"button\" (click)=\"onButtonClick()\">\n <span class=\"button__icon\" [ngClass]=\"iconClass\"></span>\n <span class=\"button__label\">{{ label }}</span>\n </button>\n <button class=\"dropdown\" (click)=\"onDropdownClick()\">\n <span class=\"dropdown__icon\" [ngClass]=\"{\n 'far': true,\n 'fa-chevron-down': !open,\n 'fa-chevron-up': open\n }\">\n </span>\n </button>\n</div>\n\n<ul *ngIf=\"this.open\" class=\"options\">\n <li *ngFor=\"let option of options\" (click)=\"onOptionClick(option)\">\n {{ option.title }}\n </li>\n</ul>",
14920
- styles: [".split-button{display:-ms-flexbox;display:flex;-webkit-user-select:none;-ms-user-select:none;user-select:none}.split-button .button{-ms-flex-align:center;align-items:center;border:none;border-radius:4px 0 0 4px;display:-ms-flexbox;display:flex;padding:8px 8px 8px 12px;transition:.3s ease-in-out}.split-button .button__icon{font-size:16px;padding:0 4px}.split-button .button__title{font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:21px}.split-button .dropdown{-ms-flex-align:center;align-items:center;border:none;border-left:1px solid #608190;border-radius:0 4px 4px 0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding:12px 8px;transition:.3s ease-in-out}.split-button--disabled{opacity:.5}.split-button--primary .button,.split-button--primary .dropdown{background-color:#428bca;color:#fff}.split-button--primary:not(.split-button--primary--disabled) .button,.split-button--primary:not(.split-button--primary--disabled) .dropdown{cursor:pointer}.split-button--primary:not(.split-button--primary--disabled) .button:hover,.split-button--primary:not(.split-button--primary--disabled) .dropdown:hover{background-color:#063951}.split-button--secondary .button,.split-button--secondary .dropdown{background-color:#7892a1;color:#fff}.split-button--secondary:not(.split-button--secondary--disabled) .button,.split-button--secondary:not(.split-button--secondary--disabled) .dropdown{cursor:pointer}.split-button--secondary:not(.split-button--secondary--disabled) .button:hover,.split-button--secondary:not(.split-button--secondary--disabled) .dropdown:hover{background-color:#697882}.split-button--default .button,.split-button--default .dropdown{background-color:unset;border:1px solid #d8d8d8;color:#333}.split-button--default:not(.split-button--default--disabled) .button,.split-button--default:not(.split-button--default--disabled) .dropdown{cursor:pointer}.split-button--default:not(.split-button--default--disabled) .button:hover,.split-button--default:not(.split-button--default--disabled) .dropdown:hover{background-color:#d8d8d8}.options{background-color:#fff;border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.25);display:inline-block;list-style:none;margin:2px 0;padding:8px 0;position:absolute;-webkit-user-select:none;-ms-user-select:none;user-select:none}.options li{color:#333;cursor:pointer;font-family:\"Open Sans\",sans-serif;font-weight:400;font-size:14px;line-height:21px;padding:8px 16px}.options li:hover{background-color:#d8d8d8}"]
15229
+ selector: "s-progressbar-indeterminate",
15230
+ template: "<div class=\"progressbar-indeterminate\">\n <div class=\"progressbar-container\">\n <div class=\"indeterminate-bar\" [ngClass]=\"{\n 'indeterminate-bar--blue': activeColor === 'blue',\n 'indeterminate-bar--green': activeColor === 'green',\n 'indeterminate-bar--red': activeColor === 'red',\n 'indeterminate-bar--yellow': activeColor === 'yellow'\n }\"></div>\n </div>\n\n <span *ngIf=\"label\" class=\"progressbar-label\">{{ label }}</span>\n</div>\n",
15231
+ styles: [".progressbar-indeterminate{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.progressbar-indeterminate .progressbar-container{background-color:#d8d8d8;border-radius:4px;height:24px;margin:8px 0;overflow:hidden;width:100%}.progressbar-indeterminate .indeterminate-bar{animation:5s infinite indeterminate-progress;background-color:#428bca;height:100%;width:40%}.progressbar-indeterminate .indeterminate-bar--blue{background-color:#428bca}.progressbar-indeterminate .indeterminate-bar--green{background-color:#0c9348}.progressbar-indeterminate .indeterminate-bar--red{background-color:#c13018}.progressbar-indeterminate .indeterminate-bar--yellow{background-color:#fcbf10}.progressbar-indeterminate .progressbar-label{font-family:\"Open Sans\" sans-serif;font-size:12px;line-height:150%;color:#212533}@keyframes indeterminate-progress{0%{transform:translateX(-250%)}100%{transform:translateX(250%)}}"]
14921
15232
  })
14922
- ], SplitButtonComponent);
15233
+ ], ProgressBarIndeterminateComponent);
14923
15234
 
14924
- let SplitButtonModule = class SplitButtonModule {
15235
+ let ProgressBarModule = class ProgressBarModule {
14925
15236
  };
14926
- SplitButtonModule = __decorate([
15237
+ ProgressBarModule = __decorate([
14927
15238
  NgModule({
14928
15239
  imports: [CommonModule],
14929
- declarations: [SplitButtonComponent],
14930
- exports: [SplitButtonComponent],
15240
+ declarations: [
15241
+ ProgressBarComponent,
15242
+ ProgressBarDeterminateComponent,
15243
+ ProgressBarIndeterminateComponent,
15244
+ ],
15245
+ exports: [ProgressBarComponent],
14931
15246
  })
14932
- ], SplitButtonModule);
15247
+ ], ProgressBarModule);
14933
15248
 
14934
- var StatsCardComponent_1;
14935
- let StatsCardComponent = StatsCardComponent_1 = class StatsCardComponent {
15249
+ let PanelComponent = class PanelComponent {
14936
15250
  constructor() {
14937
- this.id = `s-stats-card-${StatsCardComponent_1.nextId++}`;
14938
- this.alwaysWithBorder = false;
14939
- this.lightVersion = false;
14940
- this.lightMode = true;
14941
- this.iconClass = "fa fa-bar-chart";
14942
- this.color = "#339966";
14943
- this.animateNumbers = true;
14944
- this.clickable = false;
14945
- this.tooltip = "";
14946
- this.onClick = new EventEmitter();
14947
- this.ANIMATION_DURATION_MS = 200;
14948
- this.STEP_DURATION_MS = 20;
14949
- this.previousValue = "0";
14950
- this._value = "0";
14951
- }
14952
- set value(value) {
14953
- this.previousValue = this._value;
14954
- this._value = String(value);
14955
- if (this.animateNumbers)
14956
- this.updateDisplayValue();
14957
- else
14958
- this.displayValue = this.value;
14959
- }
14960
- get value() {
14961
- return this._value;
14962
- }
14963
- updateDisplayValue() {
14964
- const animationDuration = new BigNumber$1(this.ANIMATION_DURATION_MS);
14965
- const stepDuration = new BigNumber$1(this.STEP_DURATION_MS);
14966
- const animationCount = animationDuration.dividedBy(stepDuration);
14967
- const previousRawValue = new BigNumber$1(this.previousValue.replace(/\D/g, ""));
14968
- const rawValue = new BigNumber$1(this.value.replace(/\D/g, ""));
14969
- const incrementValue = rawValue.minus(previousRawValue).absoluteValue().dividedBy(animationCount);
14970
- const incremental = previousRawValue.isLessThan(rawValue);
14971
- clearInterval(this.intervalId);
14972
- this.displayValue = this.replaceNumericPositions(this.value);
14973
- let counter = previousRawValue;
14974
- this.intervalId = setInterval(() => {
14975
- if (incremental && counter.isLessThan(rawValue)) {
14976
- this.displayValue = this.replaceNumericPositions(this.displayValue, counter);
14977
- counter = counter.plus(incrementValue);
14978
- }
14979
- else if (!incremental && counter.isGreaterThan(rawValue)) {
14980
- this.displayValue = this.replaceNumericPositions(this.displayValue, counter);
14981
- counter = counter.minus(incrementValue);
14982
- }
14983
- else {
14984
- this.displayValue = this.value;
14985
- clearInterval(this.intervalId);
14986
- }
14987
- }, this.STEP_DURATION_MS);
15251
+ this.toggleable = true;
15252
+ this.collapsed = false;
15253
+ this.severity = EnumSeverity.Default;
15254
+ this.collapsedChange = new EventEmitter();
15255
+ this.EnumSeverity = EnumSeverity;
14988
15256
  }
14989
- replaceNumericPositions(value, newValue) {
14990
- const rawValue = value.replace(/[^\d]/g, "");
14991
- const newValueString = newValue ? newValue.toString() : "";
14992
- const formattedNewValue = newValueString
14993
- .toString()
14994
- .replace(/\D/g, "")
14995
- .padStart(rawValue.length, "0");
14996
- let newValueIndex = 0;
14997
- return value
14998
- .split("")
14999
- .map(char => {
15000
- const number = Number(char);
15001
- if (number || char === "0")
15002
- return formattedNewValue[newValueIndex++];
15003
- return char;
15004
- })
15005
- .join("");
15257
+ onCollapsedChange(collapsed) {
15258
+ this.collapsed = collapsed;
15259
+ this.collapsedChange.emit(this.collapsed);
15006
15260
  }
15007
15261
  };
15008
- StatsCardComponent.nextId = 0;
15009
- __decorate([
15010
- Input()
15011
- ], StatsCardComponent.prototype, "id", void 0);
15012
- __decorate([
15013
- Input()
15014
- ], StatsCardComponent.prototype, "label", void 0);
15015
- __decorate([
15016
- Input()
15017
- ], StatsCardComponent.prototype, "alwaysWithBorder", void 0);
15018
- __decorate([
15019
- Input()
15020
- ], StatsCardComponent.prototype, "lightVersion", void 0);
15021
- __decorate([
15022
- Input()
15023
- ], StatsCardComponent.prototype, "lightMode", void 0);
15024
15262
  __decorate([
15025
15263
  Input()
15026
- ], StatsCardComponent.prototype, "iconClass", void 0);
15027
- __decorate([
15028
- Input()
15029
- ], StatsCardComponent.prototype, "color", void 0);
15264
+ ], PanelComponent.prototype, "header", void 0);
15030
15265
  __decorate([
15031
15266
  Input()
15032
- ], StatsCardComponent.prototype, "animateNumbers", void 0);
15267
+ ], PanelComponent.prototype, "toggleable", void 0);
15033
15268
  __decorate([
15034
15269
  Input()
15035
- ], StatsCardComponent.prototype, "clickable", void 0);
15270
+ ], PanelComponent.prototype, "collapsed", void 0);
15036
15271
  __decorate([
15037
15272
  Input()
15038
- ], StatsCardComponent.prototype, "value", null);
15273
+ ], PanelComponent.prototype, "severity", void 0);
15039
15274
  __decorate([
15040
15275
  Input()
15041
- ], StatsCardComponent.prototype, "tooltip", void 0);
15276
+ ], PanelComponent.prototype, "borderButtonOptions", void 0);
15042
15277
  __decorate([
15043
15278
  Output()
15044
- ], StatsCardComponent.prototype, "onClick", void 0);
15045
- StatsCardComponent = StatsCardComponent_1 = __decorate([
15279
+ ], PanelComponent.prototype, "collapsedChange", void 0);
15280
+ PanelComponent = __decorate([
15046
15281
  Component({
15047
- selector: "s-stats-card",
15048
- template: "<div\n [id]=\"id\"\n class=\"s-stats-card\"\n [ngClass]=\"{\n 's-stats-card--always-border': alwaysWithBorder,\n 's-stats-card--light': lightMode,\n 's-stats-card--color': !lightMode,\n 's-stats-card--light-version': lightVersion,\n 's-stats-card--clickable': clickable\n }\"\n (click)=\"clickable && onClick.next($event)\">\n\n <div\n [id]=\"id + '-background'\"\n class=\"s-stats-card-background\"\n [ngStyle]=\"{ 'background-color': !lightMode && color || '' }\">\n </div>\n <div\n [id]=\"id + '-overlay'\"\n class=\"s-stats-card-overlay\">\n </div>\n\n <div\n [id]=\"id + '-info-container'\"\n class=\"s-stats-card-info-container\">\n <div class=\"s-stats-card-info-inner-container\">\n <div\n [id]=\"id + '-icon-container'\"\n class=\"s-stats-card-icon-container\"\n [ngStyle]=\"{ 'background-color': lightMode && color || '' }\">\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n [ngClass]=\"{ 's-stats-card-icon': true }\"\n [ngStyle]=\"{'color': !lightMode && color || ''}\"\n aria-hidden=\"true\"></span>\n </div>\n\n <div\n [id]=\"id + '-text-container'\"\n class=\"s-stats-card-text-container\">\n <h4\n [id]=\"id + '-label'\"\n class=\"s-stats-card-label\"\n [pTooltip]=\"label\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n {{ label }}\n </h4>\n <span\n [id]=\"id + '-value'\"\n class=\"s-stats-card-value\"\n [pTooltip]=\"displayValue\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n {{ displayValue }}\n </span>\n </div>\n </div>\n <div class=\"s-stats-card-content-inner-container\">\n <div #content class=\"s-stats-card-content-container\">\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"content.children.length\"\n class=\"s-stats-card-content-separator\">\n </div>\n </div>\n <span\n *ngIf=\"tooltip\"\n class=\"s-status-card-tooltip\"\n [pTooltip]=\"tooltip\"\n tooltipPosition=\"right\">\n <i class=\"fa fa-info-circle s-status-card-tooltip-icon\"></i>\n </span>\n </div>\n</div>\n",
15049
- encapsulation: ViewEncapsulation.None,
15050
- styles: ["s-stats-card{display:block;height:auto;position:relative}s-stats-card .s-stats-card{border:1px solid transparent;min-width:120px;overflow:hidden;position:relative}s-stats-card .s-stats-card .s-stats-card-background,s-stats-card .s-stats-card .s-stats-card-overlay{height:calc(100% - 2px);left:1px;position:absolute;top:1px;width:calc(100% - 2px)}s-stats-card .s-stats-card .s-stats-card-background{background-color:#fff}s-stats-card .s-stats-card .s-stats-card-overlay{background-color:#000;opacity:0;transition:opacity .2s ease-out}s-stats-card .s-stats-card .s-stats-card-info-container{overflow:auto;padding:15px;position:relative}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container{overflow:hidden;position:relative}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-icon-container{float:left;font-size:24px;height:50px;line-height:50px;text-align:center;transition:width .2s ease-out;width:50px}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container{-ms-flex-align:start;align-items:flex-start;color:#fff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;float:left;height:50px;-ms-flex-pack:center;justify-content:center;max-width:calc(100% - 65px);padding-left:15px}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-label{font-weight:400;width:100%}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-value{display:inline-block;font-size:20px;font-weight:700;width:100%}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container,s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-label,s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-content-inner-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-content-inner-container .s-stats-card-content-separator{border-top:1px solid #ccc;margin:15px 0;-ms-flex-order:1;order:1}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-content-inner-container .s-stats-card-content-container{-ms-flex-order:2;order:2}s-stats-card .s-stats-card .s-stats-card-info-container .s-status-card-tooltip{font-size:1rem;line-height:0;margin:.3rem;position:absolute;right:0;top:0}s-stats-card .s-stats-card .s-stats-card-info-container .s-status-card-tooltip .s-status-card-tooltip-icon{color:#fff}s-stats-card .s-stats-card.s-stats-card--color .s-stats-card-icon-container{background-color:#fff}s-stats-card .s-stats-card.s-stats-card--light *{color:#333}s-stats-card .s-stats-card.s-stats-card--light .s-stats-card-icon{color:#fff}s-stats-card .s-stats-card.s-stats-card--light * .s-status-card-tooltip .s-status-card-tooltip-icon,s-stats-card .s-stats-card.s-stats-card--light .s-stats-card-label{color:#999}s-stats-card .s-stats-card.s-stats-card--light-version .s-stats-card-info-inner-container .s-stats-card-icon-container{height:100%;left:0;position:absolute;right:0;width:10px}s-stats-card .s-stats-card.s-stats-card--light-version .s-stats-card-info-inner-container .s-stats-card-icon-container .s-stats-card-icon{display:none}s-stats-card .s-stats-card.s-stats-card--light-version .s-stats-card-info-inner-container .s-stats-card-text-container{height:auto;max-width:calc(100% - 25px);padding-left:25px}s-stats-card .s-stats-card.s-stats-card--clickable{cursor:pointer}s-stats-card .s-stats-card:hover .s-stats-card-overlay{opacity:.2}s-stats-card .s-stats-card.s-stats-card--light:hover .s-stats-card-overlay{opacity:.08}s-stats-card .s-stats-card.s-stats-card--light{border-color:#ccc}.s-sidebar-content .s-stats-card.s-stats-card--light:not(.s-stats-card--always-border),.ui-dialog-content .s-stats-card.s-stats-card--light:not(.s-stats-card--always-border),p-panel .s-stats-card.s-stats-card--light:not(.s-stats-card--always-border){border-color:transparent}@media (max-width:767px){s-stats-card .s-stats-card{height:auto}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-icon-container{height:100%;left:0;position:absolute;right:0;width:10px}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-icon-container .s-stats-card-icon{display:none}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container{height:auto;max-width:calc(100% - 25px);padding-left:25px}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container,s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-label,s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-value{overflow:visible;white-space:normal;word-break:break-all}}"]
15282
+ selector: "s-panel",
15283
+ template: "<p-panel\n [toggleable]=\"toggleable\"\n [collapsed]=\"collapsed\"\n [ngClass]=\"{\n 'panel--severity-default': severity === EnumSeverity.Default,\n 'panel--severity-info': severity === EnumSeverity.Info,\n 'panel--severity-warn': severity === EnumSeverity.Warn,\n 'panel--severity-error': severity === EnumSeverity.Error,\n 'panel--severity-success': severity == EnumSeverity.Success\n }\"\n (collapsedChange)=\"onCollapsedChange($event)\"\n>\n <p-header>\n <s-border-button\n *ngIf=\"\n borderButtonOptions?.visible\n ? borderButtonOptions?.visible(severity)\n : false\n \"\n [severity]=\"severity\"\n [options]=\"borderButtonOptions\"\n class=\"panel__border-button\"\n [@BorderButtonAnimation]\n ></s-border-button>\n <span>\n {{ header }}\n </span>\n </p-header>\n\n <ng-content></ng-content>\n</p-panel>",
15284
+ animations: [
15285
+ trigger("BorderButtonAnimation", [
15286
+ transition(":enter", [
15287
+ style$7({ transform: "scaleY(0)", opacity: 0 }),
15288
+ animate("300ms ease", style$7({ transform: "scaleY(1)", opacity: 1 })),
15289
+ ]),
15290
+ transition(":leave", [
15291
+ style$7({ transform: "scaleY(1)", opacity: 1 }),
15292
+ animate("300ms ease", style$7({ transform: "scaleY(0)", opacity: 0 })),
15293
+ ]),
15294
+ ]),
15295
+ ],
15296
+ styles: [":host{display:block}:host ::ng-deep .ui-panel{position:relative}:host ::ng-deep .panel--severity-default .ui-panel{border-color:#ccc}:host ::ng-deep .panel--severity-info .ui-panel{border-color:#428bca;transition:border-color .5s}:host ::ng-deep .panel--severity-warn .ui-panel{border-color:#f8931f;transition:border-color .5s}:host ::ng-deep .panel--severity-error .ui-panel{border-color:#c13018;transition:border-color .5s}:host ::ng-deep .panel--severity-success .ui-panel{border-color:#0c9348;transition:border-color .5s}.panel__border-button{position:absolute;top:-13px;right:15px;z-index:1}"]
15051
15297
  })
15052
- ], StatsCardComponent);
15298
+ ], PanelComponent);
15053
15299
 
15054
- let StatsCardModule = class StatsCardModule {
15300
+ let PanelModule = class PanelModule {
15055
15301
  };
15056
- StatsCardModule = __decorate([
15302
+ PanelModule = __decorate([
15057
15303
  NgModule({
15058
- imports: [
15059
- CommonModule,
15060
- TooltipModule$1,
15061
- ],
15062
- declarations: [
15063
- StatsCardComponent,
15064
- ],
15065
- exports: [
15066
- StatsCardComponent,
15067
- ],
15304
+ imports: [CommonModule, PanelModule$1, BorderButtonModule],
15305
+ declarations: [PanelComponent],
15306
+ exports: [PanelComponent],
15068
15307
  })
15069
- ], StatsCardModule);
15308
+ ], PanelModule);
15070
15309
 
15071
- var StepsComponent_1;
15072
- var StepState;
15073
- (function (StepState) {
15074
- StepState["Default"] = "default";
15075
- StepState["Success"] = "success";
15076
- StepState["Warning"] = "warning";
15077
- })(StepState || (StepState = {}));
15078
- let StepsComponent = StepsComponent_1 = class StepsComponent {
15310
+ var RatingScaleComponent_1;
15311
+ let RatingScaleComponent = RatingScaleComponent_1 = class RatingScaleComponent {
15079
15312
  constructor() {
15080
- this.id = `s-steps-${StepsComponent_1.nextId++}`;
15081
- this.activeIndex = 0;
15082
- this.stepSelected = new EventEmitter();
15083
- }
15084
- stepClick(step, index, event) {
15085
- if (step.disabled || index == this.activeIndex)
15086
- return;
15087
- this.stepSelected.emit({ step, index, event });
15313
+ this.disabled = false;
15088
15314
  }
15089
- get stepState() {
15090
- return StepState;
15315
+ writeValue(value) {
15316
+ if (!this.disabled) {
15317
+ this.value = value;
15318
+ }
15091
15319
  }
15092
- barAnimation(index, activeIndex) {
15093
- const visited = index < activeIndex;
15094
- const activated = index === activeIndex;
15095
- return visited || activated;
15320
+ registerOnChange(onChange) {
15321
+ this._onChange = onChange;
15096
15322
  }
15097
- afterBarAnimation(index, activeIndex) {
15098
- const visited = index < activeIndex;
15099
- const activated = index === activeIndex - 1;
15100
- return visited || activated;
15323
+ registerOnTouched(onTouched) {
15324
+ this._onTouched = onTouched;
15101
15325
  }
15102
- get visibledStep() {
15103
- return this.steps.filter((step) => !step.hidden);
15326
+ onSelect(rating) {
15327
+ this.value = rating;
15328
+ if (this._onChange) {
15329
+ this._onChange(this.value);
15330
+ }
15104
15331
  }
15105
15332
  };
15106
- StepsComponent.nextId = 0;
15107
15333
  __decorate([
15108
15334
  Input()
15109
- ], StepsComponent.prototype, "id", void 0);
15335
+ ], RatingScaleComponent.prototype, "nodes", void 0);
15110
15336
  __decorate([
15111
15337
  Input()
15112
- ], StepsComponent.prototype, "steps", void 0);
15338
+ ], RatingScaleComponent.prototype, "startLabel", void 0);
15113
15339
  __decorate([
15114
15340
  Input()
15115
- ], StepsComponent.prototype, "activeIndex", void 0);
15341
+ ], RatingScaleComponent.prototype, "endLabel", void 0);
15116
15342
  __decorate([
15117
- Output()
15118
- ], StepsComponent.prototype, "stepSelected", void 0);
15119
- StepsComponent = StepsComponent_1 = __decorate([
15120
- Component({
15121
- selector: "s-steps",
15122
- template: "<div [id]=\"id\" class=\"s-steps-container\">\n <ng-container *ngFor=\"let step of visibledStep; let i = index; let isFirst = first; let isLast = last\">\n <div *ngIf=\"!isFirst\" class=\"s-step-progress-bar\"\n [@activeDesative]=\"barAnimation(i, activeIndex) ? 'active': 'desactive'\" [ngClass]=\"{\n 's-step-success': (step.state === stepState.Success),\n 's-step-warning': (step.state === stepState.Warning),\n 's-step-disabled': step.disabled,\n 's-step-visited': (i < activeIndex),\n 's-step-active': (i === activeIndex)\n }\"></div>\n <div [id]=\"id + '-step-' + (step.id || i)\" class=\"s-step-header\" (click)=\"stepClick(step, i, $event)\" role=\"tab\"\n tabindex=\"0\" [attr.aria-label]=\"step.ariaLabel || null\" [attr.aria-controls]=\"step.ariaControls\"\n [attr.aria-labelledby]=\"!step.ariaLabel ? 'step-label-' + i : null\" [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"visibledStep.length\" [attr.aria-selected]=\"activeIndex == i\" [ngClass]=\"{\n 's-step-success': (step.state === stepState.Success),\n 's-step-warning': (step.state === stepState.Warning),\n 's-step-visited': (i < activeIndex),\n 's-step-active': (i === activeIndex),\n 's-step-previous': (i === activeIndex - 1)\n }\">\n <div *ngIf=\"!isFirst\"\n [@beforeActiveDesative]=\"barAnimation(i, activeIndex) ? 'active': 'desactive'\"\n class=\"s-step-progress-bar-before\" [ngClass]=\"{\n 's-step-success': (step.state === stepState.Success),\n 's-step-warning': (step.state === stepState.Warning),\n 's-step-disabled': step.disabled,\n 's-step-visited': (i < activeIndex),\n 's-step-active': (i === activeIndex)\n }\"></div>\n <div *ngIf=\"!isLast\"\n [@afterActiveDesative]=\"afterBarAnimation(i, activeIndex) ? 'active': 'desactive'\"\n class=\"s-step-progress-bar-after\" [ngClass]=\"{\n 's-step-success': (step.state === stepState.Success),\n 's-step-warning': (step.state === stepState.Warning),\n 's-step-disabled': visibledStep[i + 1].disabled,\n 's-step-visited': ((i + 1) < activeIndex),\n 's-step-active': (i === (activeIndex - 1))\n }\"></div>\n <div\n class=\"s-step-index\"\n [ngClass]=\"{'s-step-disabled': step.disabled}\"\n [pTooltip]=\"step.tooltip\"\n tooltipPosition=\"top\">\n <div class=\"s-step-index-content\">\n <span\n *ngIf=\"step.state !== stepState.Warning && (step.state == stepState.Success || activeIndex > i)\"\n class=\"fas fa-check\"\n aria-hidden=\"true\"\n [attr.aria-label]=\"i + 1\"></span>\n <span\n *ngIf=\"step.state == stepState.Warning\"\n class=\"fas fa-exclamation-triangle\"\n aria-hidden=\"true\"\n [attr.aria-label]=\"i + 1\"></span>\n <span\n *ngIf=\"step.state != stepState.Success && step.state != stepState.Warning && activeIndex <= i\">\n {{i + 1}}\n </span>\n </div>\n </div>\n <div\n [id]=\"'step-label-' + i\"\n class=\"s-step-label\"\n [ngClass]=\"{'s-step-disabled': step.disabled}\">\n <span>\n {{step.label}}\n </span>\n </div>\n </div>\n </ng-container>\n</div>\n",
15123
- host: {
15124
- "aria-orientation": "horizontal",
15125
- role: "tablist",
15126
- "tab-index": "0",
15127
- },
15128
- animations: [
15129
- trigger("beforeActiveDesative", [
15130
- state("active", style$7({
15131
- "background-position": "left bottom",
15132
- })),
15133
- state("desactive", style$7({
15134
- "background-position": "right bottom",
15135
- })),
15136
- transition("active => desactive", [animate("50ms 100ms linear")]),
15137
- transition("desactive => active", [animate("50ms 250ms linear")]),
15138
- ]),
15139
- trigger("activeDesative", [
15140
- state("active", style$7({
15141
- "background-position": "left bottom",
15142
- })),
15143
- state("desactive", style$7({
15144
- "background-position": "right bottom",
15145
- })),
15146
- transition("active => desactive", [animate("100ms 150ms linear")]),
15147
- transition("desactive => active", [animate("100ms 150ms linear")]),
15148
- ]),
15149
- trigger("afterActiveDesative", [
15150
- state("active", style$7({
15151
- "background-position": "left bottom",
15152
- })),
15153
- state("desactive", style$7({
15154
- "background-position": "right bottom",
15155
- })),
15156
- transition("active => desactive", [animate("50ms 250ms linear")]),
15157
- transition("desactive => active", [animate("50ms 100ms linear")]),
15158
- ]),
15159
- ],
15160
- styles: ["@keyframes scale-up-center{0%{transform:scale(.5)}100%{transform:scale(1)}}.s-steps-container{display:-ms-flexbox;display:flex;white-space:nowrap;-ms-flex-align:start;align-items:flex-start;overflow:hidden;padding:15px 10px}.s-step-header{box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;cursor:pointer;position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:66px}.s-step-header .s-step-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all;color:#999;font-size:14px;font-weight:400;padding-top:5px}.s-step-header .s-step-progress-bar-before{margin:0;position:absolute;top:20px;-ms-flex:auto;flex:auto;height:3px;overflow:hidden;width:calc(50% - 20px);background-color:#ccc;background-image:linear-gradient(to right,#7892a1 50%,#ccc 50%);background-position:right bottom;background-size:300% 100%;left:0}.s-step-header .s-step-progress-bar-before.s-step-active,.s-step-header .s-step-progress-bar-before.s-step-visited{background-position:left bottom}.s-step-header .s-step-progress-bar-after{margin:0;position:absolute;top:20px;-ms-flex:auto;flex:auto;height:3px;overflow:hidden;width:calc(50% - 20px);background-color:#ccc;background-image:linear-gradient(to right,#7892a1 50%,#ccc 50%);background-position:right bottom;background-size:300% 100%;right:0}.s-step-header .s-step-progress-bar-after.s-step-active,.s-step-header .s-step-progress-bar-after.s-step-visited{background-position:left bottom}.s-step-progress-bar{margin:0;position:relative;top:20px;-ms-flex:auto;flex:auto;height:3px;overflow:hidden;width:100%;background-color:#ccc;background-image:linear-gradient(to right,#7892a1 50%,#ccc 50%);background-position:right bottom;background-size:300% 100%}.s-step-disabled{opacity:.5;filter:Alpha(Opacity=50)}.s-step-disabled,.s-step-disabled *{cursor:text!important}.s-step-active.s-step-disabled{opacity:1}.s-step-index{background-color:#fff;border:3px solid #ccc;border-radius:50%;color:#999;display:inline-block;font-weight:700;position:relative;transition:background-color .2s ease-out;height:40px;width:40px;-ms-flex:none;flex:none}.s-step-index .s-step-index-content{line-height:18px;font-size:18px;padding-top:8.5px;text-align:center;position:relative;cursor:pointer}.s-step-index:hover{background-color:#f7f7f7}.s-step-warning .s-step-index .s-step-index-content{padding-top:7px}.s-step-visited .s-step-index{border-color:#7892a1;animation:.1s ease-out alternate scale-up-center;background-color:#7892a1}.s-step-visited .s-step-index-content>span{color:#fff}.s-step-active.s-step-progress-bar,.s-step-visited.s-step-progress-bar{background-position:left bottom}.s-step-active .s-step-index{border-color:#7892a1;color:#7892a1;cursor:default}.s-step-active .s-step-label{color:#333;font-weight:700}@media (max-width:767px){.s-step-label{display:none}}"]
15343
+ Input()
15344
+ ], RatingScaleComponent.prototype, "disabled", void 0);
15345
+ RatingScaleComponent = RatingScaleComponent_1 = __decorate([
15346
+ Component({
15347
+ selector: "s-rating-scale",
15348
+ template: "<div\n class=\"rating-scale\"\n [ngClass]=\"{ 'rating-scale--disabled': disabled }\">\n <div class=\"nodes\">\n <button\n *ngFor=\"let node of nodes; index as i\"\n class=\"node\"\n [ngClass]=\"{ 'node--selected': value?.id === node.id && !disabled }\"\n tabindex=\"0\"\n (click)=\"onSelect(node)\"> \n <span\n *ngIf=\"node.icon\"\n class=\"icon fas\"\n [ngClass]=\"node.icon\">\n </span>\n <span\n *ngIf=\"node.title\"\n class=\"label\">\n {{ node.title }}\n </span>\n </button>\n </div>\n <div class=\"labels\">\n <span>{{ startLabel }}</span>\n <span>{{ endLabel }}</span>\n </div>\n</div>",
15349
+ providers: [{
15350
+ provide: NG_VALUE_ACCESSOR,
15351
+ useExisting: forwardRef(() => RatingScaleComponent_1),
15352
+ multi: true,
15353
+ }],
15354
+ styles: [".rating-scale{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.rating-scale .nodes{display:-ms-flexbox;display:flex}.rating-scale .nodes .node{-ms-flex-align:center;align-items:center;background-color:#fff;border-radius:6px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-pack:center;justify-content:center;margin:0 2px;padding:8px;border:1px solid #7892a1}.rating-scale .nodes .node .icon{color:#6e7280;font-size:1rem}.rating-scale .nodes .node .label{color:#212533;font-size:.875rem;font-weight:400;line-height:150%}.rating-scale .nodes .node .icon,.rating-scale .nodes .node .label{margin:6px}.rating-scale .nodes .node--selected{background-color:#d5e8ec;border-color:#428bca;color:#428bca}.rating-scale .nodes .node:first-child{margin-left:0}.rating-scale .nodes .node:last-child{margin-right:0}.rating-scale .labels{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px 0}.rating-scale .labels span{color:#080808;font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:400;line-height:150%}.rating-scale--disabled{opacity:.5}.rating-scale:not(.rating-scale--disabled) .node{cursor:pointer}.rating-scale:not(.rating-scale--disabled) .node:hover{background-color:#dedce5}.rating-scale:not(.rating-scale--disabled) .node:focus{border-width:2px;outline:0}"]
15161
15355
  })
15162
- ], StepsComponent);
15356
+ ], RatingScaleComponent);
15163
15357
 
15164
- let StepsModule = class StepsModule {
15358
+ let RatingScaleModule = class RatingScaleModule {
15165
15359
  };
15166
- StepsModule = __decorate([
15360
+ RatingScaleModule = __decorate([
15167
15361
  NgModule({
15168
- imports: [CommonModule, TooltipModule$1],
15169
- declarations: [StepsComponent],
15170
- exports: [StepsComponent],
15362
+ imports: [
15363
+ CommonModule,
15364
+ ReactiveFormsModule,
15365
+ ],
15366
+ declarations: [RatingScaleComponent],
15367
+ exports: [RatingScaleComponent],
15171
15368
  })
15172
- ], StepsModule);
15173
-
15174
- let TieredMenuEventService = class TieredMenuEventService {
15175
- constructor() {
15176
- this.incrementCurrentItemEvent = new EventEmitter();
15177
- this.decrementCurrentItemEvent = new EventEmitter();
15178
- this.closeAllMenusEvent = new EventEmitter();
15179
- this.selectItemEvent = new EventEmitter();
15180
- this.openItemMenuEvent = new EventEmitter();
15181
- this.closeItemMenuEvent = new EventEmitter();
15182
- this.createMenuEvent = new EventEmitter();
15183
- }
15184
- };
15185
- TieredMenuEventService = __decorate([
15186
- Injectable()
15187
- ], TieredMenuEventService);
15369
+ ], RatingScaleModule);
15188
15370
 
15189
- let TieredMenuService = class TieredMenuService {
15371
+ var SelectButtonComponent_1;
15372
+ let SelectButtonComponent = SelectButtonComponent_1 = class SelectButtonComponent {
15190
15373
  constructor() {
15191
- this.currentItems = [];
15192
- this.items = [];
15193
- }
15194
- normalizeData(items, parent) {
15195
- return items.map((i) => {
15196
- const item = Object.assign({ visible: true }, i);
15197
- if (item.submenu) {
15198
- item.submenu = this.normalizeData(item.submenu, item);
15199
- }
15200
- item.id = this._generateId();
15201
- item.parent = parent;
15202
- item.isOpen = false;
15203
- return item;
15204
- });
15205
- }
15206
- markAllItemsAsClosed(items) {
15207
- return items.map((i) => {
15208
- const item = Object.assign({}, i);
15209
- if (item.submenu) {
15210
- item.submenu = this.markAllItemsAsClosed(item.submenu);
15211
- }
15212
- item.isOpen = false;
15213
- return item;
15214
- });
15215
- }
15216
- searchTheHierarchy(itemA, itemB) {
15217
- let item = itemB;
15218
- while (item) {
15219
- if (item === itemA) {
15220
- return true;
15221
- }
15222
- item = item.parent;
15223
- }
15224
- return false;
15225
- }
15226
- cloneItems(items) {
15227
- return JSON.parse(JSON.stringify(items));
15228
- }
15229
- _generateId() {
15230
- return `id-${Math.random().toString(36).substring(2, 9)}-${Math.random().toString(36).substring(2, 9)}-${Math.random().toString(36).substring(2, 9)}`;
15231
- }
15232
- };
15233
- TieredMenuService = __decorate([
15234
- Injectable()
15235
- ], TieredMenuService);
15236
-
15237
- let TieredMenuNestedComponent = class TieredMenuNestedComponent {
15238
- constructor(tieredMenuService, _tieredMenuEventService) {
15239
- this.tieredMenuService = tieredMenuService;
15240
- this._tieredMenuEventService = _tieredMenuEventService;
15241
- this.top = 0;
15242
- this.left = 0;
15243
- this._unsubscribe$ = new Subject();
15244
- }
15245
- onResize() {
15246
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15374
+ this.multiple = false;
15375
+ this.itemSelected = new EventEmitter();
15376
+ this.itemClicked = new EventEmitter();
15377
+ this.disabled = false;
15378
+ this.activeItems = new Set();
15247
15379
  }
15248
- onDocumentClick(event) {
15249
- // Closing menu when clicked outside.
15250
- const target = event.target;
15251
- const clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
15252
- if (!clickedInside) {
15253
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15380
+ writeValue(value) {
15381
+ if (!value)
15382
+ return;
15383
+ this.activeItems.clear();
15384
+ if (Array.isArray(value)) {
15385
+ value.forEach((item) => {
15386
+ this.items.forEach((iItem) => {
15387
+ if (this._compareItems(item, iItem)) {
15388
+ this.activeItems.add(iItem);
15389
+ }
15390
+ });
15391
+ });
15254
15392
  }
15255
- }
15256
- onKeydownHandler(event) {
15257
- switch (event.key) {
15258
- case "Escape":
15259
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15260
- break;
15261
- case " ":
15262
- case "Enter":
15263
- this._tieredMenuEventService.selectItemEvent.emit(this.tieredMenuService.currentItem);
15264
- break;
15265
- case "ArrowLeft":
15266
- // When nested I need a reference to the current item's parent item, otherwise just the current item.
15267
- this._tieredMenuEventService.closeItemMenuEvent.emit(this.tieredMenuService.currentItem.parent);
15268
- break;
15269
- case "ArrowRight":
15270
- this._tieredMenuEventService.openItemMenuEvent.emit(this.tieredMenuService.currentItem);
15271
- break;
15272
- case "ArrowUp":
15273
- this._tieredMenuEventService.decrementCurrentItemEvent.emit();
15274
- break;
15275
- case "ArrowDown":
15276
- this._tieredMenuEventService.incrementCurrentItemEvent.emit();
15277
- break;
15393
+ else {
15394
+ this.items.forEach((iItem) => {
15395
+ if (this._compareItems(value, iItem)) {
15396
+ this.activeItems.add(iItem);
15397
+ }
15398
+ });
15278
15399
  }
15279
15400
  }
15280
- ngOnInit() {
15281
- this.tieredMenuService.currentItems = this.items;
15282
- this._subscribeEvents();
15401
+ registerOnChange(onChange) {
15402
+ this.onChange = onChange;
15283
15403
  }
15284
- ngOnDestroy() {
15285
- this._unsubscribe$.next();
15286
- this._unsubscribe$.complete();
15404
+ registerOnTouched(onTouched) {
15405
+ this.onTouched = onTouched;
15287
15406
  }
15288
- _incrementCurItem() {
15289
- if (!this.tieredMenuService.currentItem) {
15290
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15291
- return;
15292
- }
15293
- const curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
15294
- if (curIndex < this.tieredMenuService.currentItems.length) {
15295
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
15296
- }
15297
- else {
15298
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15299
- }
15300
- if (this.tieredMenuService.currentItem.divider) {
15301
- this._incrementCurItem();
15302
- }
15407
+ setDisabledState(disabled) {
15408
+ this.disabled = disabled;
15303
15409
  }
15304
- _decrementCurItem() {
15305
- if (!this.tieredMenuService.currentItem) {
15306
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15410
+ onItemSelect(item) {
15411
+ var _a, _b;
15412
+ if (this.disabled || item.disabled)
15307
15413
  return;
15414
+ this.itemClicked.emit(item);
15415
+ if (!this.multiple) {
15416
+ this.activeItems.clear();
15308
15417
  }
15309
- const curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
15310
- if (curIndex >= 0) {
15311
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
15312
- }
15313
- else {
15314
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
15315
- }
15316
- if (this.tieredMenuService.currentItem.divider) {
15317
- this._decrementCurItem();
15318
- }
15319
- }
15320
- _closeItem(item) {
15321
- var _a;
15322
- let itemAux = this._lastOpenItem;
15323
- while (itemAux && itemAux != item) {
15324
- itemAux.isOpen = false;
15325
- itemAux = itemAux.parent;
15326
- }
15327
- item.isOpen = false;
15328
- this.tieredMenuService.currentItem = itemAux !== null && itemAux !== void 0 ? itemAux : this.tieredMenuService.items[0];
15329
- this.tieredMenuService.currentItems = ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.submenu) || this.tieredMenuService.items;
15418
+ this.activeItems.add(item);
15419
+ this.itemSelected.emit([...this.activeItems]);
15420
+ (_a = this.onChange) === null || _a === void 0 ? void 0 : _a.call(this, [...this.activeItems]);
15421
+ (_b = this.onTouched) === null || _b === void 0 ? void 0 : _b.call(this, [...this.activeItems]);
15330
15422
  }
15331
- _openItem(item) {
15332
- if (item === null || item === void 0 ? void 0 : item.submenu) {
15333
- item.isOpen = true;
15334
- this.tieredMenuService.currentItems = item.submenu;
15335
- // Only has focus if there has already been interaction.
15336
- if (this.tieredMenuService.currentItem) {
15337
- this.tieredMenuService.currentItem = item.submenu[0];
15423
+ _compareItems(item1, item2) {
15424
+ const _compare = (a, b) => {
15425
+ if (a === b) {
15426
+ return true;
15338
15427
  }
15339
- this._lastOpenItem = item;
15340
- }
15341
- }
15342
- _subscribeEvents() {
15343
- this._tieredMenuEventService.incrementCurrentItemEvent
15344
- .pipe(takeUntil(this._unsubscribe$))
15345
- .subscribe(() => {
15346
- this._incrementCurItem();
15347
- });
15348
- this._tieredMenuEventService.decrementCurrentItemEvent
15349
- .pipe(takeUntil(this._unsubscribe$))
15350
- .subscribe(() => {
15351
- this._decrementCurItem();
15352
- });
15353
- this._tieredMenuEventService.selectItemEvent
15354
- .pipe(takeUntil(this._unsubscribe$))
15355
- .subscribe((item) => {
15356
- if (item.command) {
15357
- item.command();
15358
- // Close all menus after the item was selected.
15359
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15428
+ if (a === undefined || b === undefined || typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
15429
+ return false;
15360
15430
  }
15361
- });
15362
- this._tieredMenuEventService.openItemMenuEvent
15363
- .pipe(takeUntil(this._unsubscribe$))
15364
- .subscribe((item) => {
15365
- var _a, _b;
15366
- if (!this.tieredMenuService.currentItems.includes(item)) {
15367
- let itemAux = this._lastOpenItem;
15368
- while ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.parent) {
15369
- itemAux = itemAux.parent;
15431
+ if (Array.isArray(a) !== Array.isArray(b)) {
15432
+ return false;
15433
+ }
15434
+ let keysA = Object.keys(a);
15435
+ let keysB = Object.keys(b);
15436
+ if (keysA.length !== keysB.length) {
15437
+ return false;
15438
+ }
15439
+ for (let key of keysA) {
15440
+ if (!keysB.includes(key) || !_compare(a[key], b[key])) {
15441
+ return false;
15370
15442
  }
15371
- this._tieredMenuEventService.closeItemMenuEvent.emit((_b = itemAux.parent) !== null && _b !== void 0 ? _b : itemAux);
15372
15443
  }
15373
- this._lastOpenItem = item;
15374
- this._openItem(item);
15375
- });
15376
- this._tieredMenuEventService.closeItemMenuEvent
15377
- .pipe(takeUntil(this._unsubscribe$))
15378
- .subscribe((item) => {
15379
- if (item) {
15380
- this._closeItem(item);
15444
+ for (let key in a) {
15445
+ if (a.hasOwnProperty(key) !== b.hasOwnProperty(key)) {
15446
+ return false;
15447
+ }
15381
15448
  }
15382
- });
15449
+ return true;
15450
+ };
15451
+ return _compare(item1, item2);
15383
15452
  }
15384
15453
  };
15385
- TieredMenuNestedComponent.ctorParameters = () => [
15386
- { type: TieredMenuService },
15387
- { type: TieredMenuEventService }
15388
- ];
15389
15454
  __decorate([
15390
- HostListener("window:resize")
15391
- ], TieredMenuNestedComponent.prototype, "onResize", null);
15455
+ Input()
15456
+ ], SelectButtonComponent.prototype, "items", void 0);
15392
15457
  __decorate([
15393
- HostListener("document:click", ["$event"])
15394
- ], TieredMenuNestedComponent.prototype, "onDocumentClick", null);
15458
+ Input()
15459
+ ], SelectButtonComponent.prototype, "multiple", void 0);
15395
15460
  __decorate([
15396
- HostListener("document:keydown", ["$event"])
15397
- ], TieredMenuNestedComponent.prototype, "onKeydownHandler", null);
15398
- TieredMenuNestedComponent = __decorate([
15461
+ Output()
15462
+ ], SelectButtonComponent.prototype, "itemSelected", void 0);
15463
+ __decorate([
15464
+ Output()
15465
+ ], SelectButtonComponent.prototype, "itemClicked", void 0);
15466
+ SelectButtonComponent = SelectButtonComponent_1 = __decorate([
15399
15467
  Component({
15400
- template: "<div\n class=\"menu menu--nested\"\n [ngStyle]=\"{\n 'top': top + 'px',\n 'left': left + '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.visible && !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",
15401
- 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:absolute;z-index:9999;overflow:auto;width:calc(100vw - 8px)}.menu .submenu{margin-left:24px}"]
15468
+ selector: "s-select-button",
15469
+ template: "<div\n class=\"select-button\"\n [ngClass]=\"{ 'select-button--disabled': disabled }\">\n <s-select-button-item\n *ngFor=\"let item of items; index as i\"\n [label]=\"item.label\"\n [active]=\"activeItems?.has(item)\"\n [disabled]=\"disabled || item.disabled\"\n [first]=\"i === 0\"\n [last]=\"i === items.length - 1\"\n (click)=\"onItemSelect(item)\">\n </s-select-button-item>\n</div>",
15470
+ providers: [
15471
+ {
15472
+ provide: NG_VALUE_ACCESSOR,
15473
+ useExisting: forwardRef(() => SelectButtonComponent_1),
15474
+ multi: true,
15475
+ },
15476
+ ],
15477
+ styles: [".select-button{overflow:hidden}"]
15402
15478
  })
15403
- ], TieredMenuNestedComponent);
15479
+ ], SelectButtonComponent);
15404
15480
 
15405
- var TieredMenuComponent_1;
15406
- let TieredMenuComponent = TieredMenuComponent_1 = class TieredMenuComponent {
15407
- constructor(_appRef, _componentFactoryResolver, _injector, _changeDetectorRef, tieredMenuService, _tieredMenuEventService) {
15408
- this._appRef = _appRef;
15409
- this._componentFactoryResolver = _componentFactoryResolver;
15410
- this._injector = _injector;
15411
- this._changeDetectorRef = _changeDetectorRef;
15412
- this.tieredMenuService = tieredMenuService;
15413
- this._tieredMenuEventService = _tieredMenuEventService;
15414
- this.top = 0;
15415
- this.left = 0;
15416
- this.menuTriggerEvent = "hover";
15417
- this._componentRef = null;
15418
- this._unsubscribe$ = new Subject();
15419
- this.destroyRequest = new EventEmitter();
15420
- }
15421
- onResize() {
15422
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15423
- }
15424
- onDocumentClick(event) {
15425
- // Closing menu when clicked outside.
15426
- const target = event.target;
15427
- const clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
15428
- if (!clickedInside) {
15429
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15430
- }
15481
+ let SelectButtonItemComponent = class SelectButtonItemComponent {
15482
+ constructor() {
15483
+ this.active = false;
15484
+ this.first = false;
15485
+ this.last = false;
15486
+ this.disabled = false;
15431
15487
  }
15432
- onKeydownHandler(event) {
15433
- switch (event.key) {
15434
- case "Escape":
15435
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15436
- break;
15437
- case " ":
15438
- case "Enter":
15439
- if (!this.tieredMenuService.currentItem.disabled) {
15440
- this._tieredMenuEventService.selectItemEvent.emit(this.tieredMenuService.currentItem);
15441
- }
15442
- break;
15443
- case "ArrowLeft":
15444
- if (this.items.includes(this.tieredMenuService.currentItem)) {
15445
- this._tieredMenuEventService.closeItemMenuEvent.emit(this.tieredMenuService.currentItem);
15446
- this._changeDetectorRef.detectChanges();
15447
- }
15448
- break;
15449
- case "ArrowRight":
15450
- if (!this.tieredMenuService.currentItem.disabled && this.items.includes(this.tieredMenuService.currentItem)) {
15451
- this._tieredMenuEventService.openItemMenuEvent.emit(this.tieredMenuService.currentItem);
15452
- event.stopImmediatePropagation();
15453
- }
15454
- break;
15455
- case "ArrowUp":
15456
- if (!this.tieredMenuService.currentItem || this.items.includes(this.tieredMenuService.currentItem)) {
15457
- this._tieredMenuEventService.decrementCurrentItemEvent.emit();
15458
- event.stopImmediatePropagation();
15459
- }
15460
- break;
15461
- case "ArrowDown":
15462
- if (!this.tieredMenuService.currentItem || this.items.includes(this.tieredMenuService.currentItem)) {
15463
- this._tieredMenuEventService.incrementCurrentItemEvent.emit();
15464
- event.stopImmediatePropagation();
15465
- }
15466
- break;
15467
- }
15488
+ };
15489
+ __decorate([
15490
+ Input()
15491
+ ], SelectButtonItemComponent.prototype, "label", void 0);
15492
+ __decorate([
15493
+ Input()
15494
+ ], SelectButtonItemComponent.prototype, "active", void 0);
15495
+ __decorate([
15496
+ Input()
15497
+ ], SelectButtonItemComponent.prototype, "first", void 0);
15498
+ __decorate([
15499
+ Input()
15500
+ ], SelectButtonItemComponent.prototype, "last", void 0);
15501
+ __decorate([
15502
+ Input()
15503
+ ], SelectButtonItemComponent.prototype, "disabled", void 0);
15504
+ SelectButtonItemComponent = __decorate([
15505
+ Component({
15506
+ selector: "s-select-button-item",
15507
+ template: "<button\n class=\"select-button-item\"\n [ngClass]=\"{\n 'select-button-item--active': active,\n 'select-button-item--disabled': disabled,\n 'select-button-item--first': first,\n 'select-button-item--last': last\n }\">\n <span class=\"select-button-item__label\">{{ label }}</span>\n</button>",
15508
+ styles: [".select-button-item{padding:8px 12px;cursor:pointer;background-color:#fff;border:none;border-left:1px solid #c1c1cc;border-top:1px solid #c1c1cc;border-bottom:1px solid #c1c1cc}.select-button-item__label{font-family:\"Open Sans\" sans-serif;font-size:14px}.select-button-item:not(.select-button-item--disabled):not(.select-button-item--active):hover{background-color:#eeebf2}.select-button-item--active,.select-button-item--active:hover{background-color:#c1c1cc;font-weight:700}.select-button-item--disabled{opacity:.5;cursor:default}.select-button-item--first{border-top-left-radius:2px;border-bottom-left-radius:2px}.select-button-item--last{border-right:1px solid #c1c1cc;border-top-right-radius:2px;border-bottom-right-radius:2px}"]
15509
+ })
15510
+ ], SelectButtonItemComponent);
15511
+
15512
+ let SelectButtonModule = class SelectButtonModule {
15513
+ };
15514
+ SelectButtonModule = __decorate([
15515
+ NgModule({
15516
+ imports: [CommonModule],
15517
+ declarations: [
15518
+ SelectButtonComponent,
15519
+ SelectButtonItemComponent,
15520
+ ],
15521
+ exports: [SelectButtonComponent],
15522
+ })
15523
+ ], SelectButtonModule);
15524
+
15525
+ var SidebarComponent_1;
15526
+ let SidebarComponent = SidebarComponent_1 = class SidebarComponent {
15527
+ constructor(focusTrapFactory) {
15528
+ this.focusTrapFactory = focusTrapFactory;
15529
+ this.id = `s-sidebar-${SidebarComponent_1.nextId++}`;
15530
+ this.visible = false;
15531
+ this.baseZIndex = 0;
15532
+ this.largeSized = false;
15533
+ this.visibleChange = new EventEmitter();
15468
15534
  }
15469
- ngOnInit() {
15470
- this.tieredMenuService.currentItems = this.items;
15471
- this._subscribeEvents();
15535
+ onShow() {
15536
+ DomHandler.addClass(document.body, "ui-overflow-hidden-sidebar");
15537
+ const focusTrap = this.focusTrapFactory.create(this.innerSidebar.containerViewChild.nativeElement, false);
15538
+ focusTrap.focusInitialElementWhenReady();
15472
15539
  }
15473
- ngOnDestroy() {
15474
- this._unsubscribe$.next();
15475
- this._unsubscribe$.complete();
15540
+ onHide() {
15541
+ DomHandler.removeClass(document.body, "ui-overflow-hidden-sidebar");
15476
15542
  }
15477
- _incrementCurItem() {
15478
- if (!this.tieredMenuService.currentItem) {
15479
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15480
- return;
15481
- }
15482
- else if (!this.items.includes(this.tieredMenuService.currentItem)) {
15483
- // Checking if it is the current menu.
15484
- return;
15485
- }
15486
- const currentIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
15487
- if (currentIndex < this.tieredMenuService.currentItems.length) {
15488
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[currentIndex];
15489
- }
15490
- else {
15491
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15492
- }
15493
- if (this.tieredMenuService.currentItem.divider) {
15494
- this._incrementCurItem();
15495
- }
15543
+ close(event) {
15544
+ DomHandler.removeClass(document.body, "ui-overflow-hidden-sidebar");
15545
+ this.visibleChange.emit(false);
15546
+ event.preventDefault();
15496
15547
  }
15497
- _decrementCurItem() {
15498
- if (!this.tieredMenuService.currentItem) {
15499
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15500
- return;
15501
- // Checking if it is the current menu.
15548
+ };
15549
+ SidebarComponent.nextId = 0;
15550
+ SidebarComponent.ctorParameters = () => [
15551
+ { type: FocusTrapFactory }
15552
+ ];
15553
+ __decorate([
15554
+ Input()
15555
+ ], SidebarComponent.prototype, "id", void 0);
15556
+ __decorate([
15557
+ Input()
15558
+ ], SidebarComponent.prototype, "visible", void 0);
15559
+ __decorate([
15560
+ Input()
15561
+ ], SidebarComponent.prototype, "header", void 0);
15562
+ __decorate([
15563
+ Input()
15564
+ ], SidebarComponent.prototype, "baseZIndex", void 0);
15565
+ __decorate([
15566
+ Input()
15567
+ ], SidebarComponent.prototype, "largeSized", void 0);
15568
+ __decorate([
15569
+ Output()
15570
+ ], SidebarComponent.prototype, "visibleChange", void 0);
15571
+ __decorate([
15572
+ ViewChild(Sidebar, { static: true })
15573
+ ], SidebarComponent.prototype, "innerSidebar", void 0);
15574
+ __decorate([
15575
+ ContentChild(HeaderComponent, { static: true })
15576
+ ], SidebarComponent.prototype, "headerSection", void 0);
15577
+ __decorate([
15578
+ ContentChild(FooterComponent, { static: true })
15579
+ ], SidebarComponent.prototype, "footerSection", void 0);
15580
+ SidebarComponent = SidebarComponent_1 = __decorate([
15581
+ Component({
15582
+ selector: "s-sidebar",
15583
+ template: "<p-sidebar\n [id]=\"id\"\n [visible]=\"visible\"\n (visibleChange)=\"visibleChange.emit($event)\"\n [blockScroll]=\"true\"\n [baseZIndex]=\"baseZIndex\"\n [modal]=\"true\"\n [dismissible]=\"false\"\n [showCloseIcon]=\"false\"\n position=\"right\"\n appendTo=\"body\"\n [styleClass]=\"largeSized ? 's-sidebar-panel s-sidebar-panel-lg' : 's-sidebar-panel'\"\n (onShow)=\"onShow()\"\n (onHide)=\"onHide()\">\n <div\n [id]=\"id + '-container'\"\n class=\"s-sidebar-container\">\n <a\n href=\"#\"\n role=\"button\"\n class=\"s-sidebar-close\"\n (click)=\"close($event)\">\n <span\n class=\"fa fa-times\"\n aria-hidden=\"true\">\n </span></a>\n <div\n *ngIf=\"header && !headerSection\" \n [id]=\"id + '-header'\"\n class=\"s-sidebar-header\">\n <h2 class=\"sds-panel-title s-sidebar-header__title\">{{header}}</h2>\n </div>\n <div\n *ngIf=\"headerSection\" \n [id]=\"id + '-header'\"\n class=\"s-sidebar-header\">\n <ng-content select=\"s-header\"></ng-content>\n </div>\n <p-scrollPanel\n [id]=\"id + '-content-container'\"\n class=\"s-sidebar-content-container\"\n styleClass=\"s-sidebar-content\">\n <ng-content></ng-content>\n </p-scrollPanel>\n <div\n *ngIf=\"footerSection\"\n [id]=\"id + '-footer'\"\n class=\"s-sidebar-footer\">\n <ng-content select=\"s-footer\"></ng-content>\n </div>\n </div>\n</p-sidebar>\n",
15584
+ encapsulation: ViewEncapsulation.None,
15585
+ styles: [".ui-overflow-hidden-sidebar{overflow:hidden}body .ui-sidebar.s-sidebar-panel{width:50%;padding:0}@media (max-width:767px){body .ui-sidebar.s-sidebar-panel{width:100%}}@media (min-width:768px){body .ui-sidebar.s-sidebar-panel{width:75%}}@media (min-width:992px){body .ui-sidebar.s-sidebar-panel{width:50%}body .ui-sidebar.s-sidebar-panel.s-sidebar-panel-lg{width:75%}}body .ui-sidebar.s-sidebar-panel .s-sidebar-container{height:100%;width:100%;padding:20px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:column;flex-direction:column}body .ui-sidebar.s-sidebar-panel .s-sidebar-close{position:absolute;right:20px;top:20px;color:#333}body .ui-sidebar.s-sidebar-panel .s-sidebar-header{border-bottom:1px solid #ccc;padding-bottom:15px;padding-right:20px;margin-bottom:15px;-ms-flex-negative:0;flex-shrink:0}body .ui-sidebar.s-sidebar-panel .s-sidebar-content-container{-ms-flex:1;flex:1;overflow:hidden}body .ui-sidebar.s-sidebar-panel .s-sidebar-content{height:100%}body .ui-sidebar.s-sidebar-panel .s-sidebar-footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;-ms-flex-negative:0;flex-shrink:0}body .ui-sidebar.s-sidebar-panel p-scrollpanel{padding-top:30px}body .ui-sidebar.s-sidebar-panel .s-sidebar-header+p-scrollpanel{padding-top:0}p-scrollPanel{display:block}.s-sidebar-header__title{font-weight:400}"]
15586
+ })
15587
+ ], SidebarComponent);
15588
+
15589
+ let SidebarModule = class SidebarModule {
15590
+ };
15591
+ SidebarModule = __decorate([
15592
+ NgModule({
15593
+ imports: [CommonModule, A11yModule, SidebarModule$1, ScrollPanelModule, StructureModule],
15594
+ declarations: [SidebarComponent],
15595
+ exports: [StructureModule, SidebarComponent],
15596
+ })
15597
+ ], SidebarModule);
15598
+
15599
+ let SlidePanelService = class SlidePanelService {
15600
+ constructor() {
15601
+ this.modalCloseMap = new Map();
15602
+ }
15603
+ createSlidePanel(id) {
15604
+ const panelSubject = new Subject();
15605
+ this.modalCloseMap.set(id, panelSubject);
15606
+ return panelSubject.asObservable();
15607
+ }
15608
+ getModalCloseObservable(id) {
15609
+ return this.modalCloseMap.get(id).asObservable();
15610
+ }
15611
+ closeModal(id) {
15612
+ const subject = this.modalCloseMap.get(id);
15613
+ if (subject) {
15614
+ subject.next();
15502
15615
  }
15503
- else if (!this.items.includes(this.tieredMenuService.currentItem)) {
15616
+ }
15617
+ };
15618
+ SlidePanelService = __decorate([
15619
+ Injectable()
15620
+ ], SlidePanelService);
15621
+
15622
+ var SlidePanelComponent_1;
15623
+ const SMALL_DEVICE_BREAKPOINT = 420;
15624
+ let SlidePanelComponent = SlidePanelComponent_1 = class SlidePanelComponent {
15625
+ constructor(slidePanelService) {
15626
+ this.slidePanelService = slidePanelService;
15627
+ this.id = `slide-panel-${++SlidePanelComponent_1.nextId}`;
15628
+ this.openIcon = "fas fa-chevron-right";
15629
+ this.closeIcon = "fas fa-chevron-left";
15630
+ this.cache = false;
15631
+ this.createOpen = false;
15632
+ this.panelOpened = new EventEmitter();
15633
+ this.panelClosed = new EventEmitter();
15634
+ this.isOpen = false;
15635
+ this.isSlideOver = false;
15636
+ this.isAnimating = false;
15637
+ this.isContentAnimationDisabled = true;
15638
+ this.slideHeight = 0;
15639
+ this.sideContentWidth = 0;
15640
+ this._unsubscribe$ = new Subject();
15641
+ }
15642
+ onResize() {
15643
+ this._checkOverBehavior();
15644
+ }
15645
+ ngOnInit() {
15646
+ this._checkOverBehavior();
15647
+ this.slidePanelService.createSlidePanel(this.id)
15648
+ .pipe(takeUntil(this._unsubscribe$))
15649
+ .subscribe(() => {
15650
+ this.isOpen = false;
15651
+ });
15652
+ }
15653
+ ngAfterViewInit() {
15654
+ queueMicrotask(() => {
15655
+ if (this.createOpen) {
15656
+ this.isOpen = true;
15657
+ }
15658
+ });
15659
+ }
15660
+ ngAfterViewChecked() {
15661
+ // to executed at a safe time prior to control returning to the browser's event loop
15662
+ queueMicrotask(() => {
15663
+ this._calculateSlideHeight();
15664
+ this._calculateSideContentWidth();
15665
+ this.isContentAnimationDisabled = false;
15666
+ });
15667
+ }
15668
+ ngOnDestroy() {
15669
+ this._unsubscribe$.next();
15670
+ this._unsubscribe$.complete();
15671
+ }
15672
+ onClickButton() {
15673
+ if (this.isAnimating) {
15504
15674
  return;
15505
15675
  }
15506
- const curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
15507
- if (curIndex >= 0) {
15508
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
15676
+ this.isOpen = !this.isOpen;
15677
+ if (this.isOpen) {
15678
+ this.panelOpened.emit();
15509
15679
  }
15510
15680
  else {
15511
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
15512
- }
15513
- if (this.tieredMenuService.currentItem.divider) {
15514
- this._decrementCurItem();
15681
+ this.panelClosed.emit();
15515
15682
  }
15516
15683
  }
15517
- _createMenu(items, position) {
15518
- if (!this._componentRef && items) {
15519
- const componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent_1);
15520
- this._componentRef = componentFactory.create(this._injector);
15521
- this._appRef.attachView(this._componentRef.hostView);
15522
- const domElem = this._componentRef.hostView.rootNodes[0];
15523
- document.body.appendChild(domElem);
15524
- // Setting the menu items.
15525
- this._componentRef.instance.items = items;
15526
- // Subscribe menu events.
15527
- this._componentRef.instance.destroyRequest.subscribe((propagate) => {
15528
- this._destroy(propagate);
15529
- });
15530
- this._menuDivElement = domElem.querySelector(".menu");
15531
- this._setMenuPosition(position);
15532
- }
15684
+ onContentAnimationStart() {
15685
+ this.isAnimating = true;
15533
15686
  }
15534
- _destroy(propagate = true) {
15535
- if (this._componentRef !== null) {
15536
- this._appRef.detachView(this._componentRef.hostView);
15537
- this._componentRef.destroy();
15538
- this._componentRef = null;
15539
- this._menuDivElement = null;
15540
- }
15541
- if (propagate) {
15542
- this.destroyRequest.emit();
15687
+ onContentAnimationDone() {
15688
+ this.isAnimating = false;
15689
+ this._calculateSideContentWidth();
15690
+ }
15691
+ _checkOverBehavior() {
15692
+ this.isSlideOver = window.innerWidth <= SMALL_DEVICE_BREAKPOINT;
15693
+ }
15694
+ _calculateSlideHeight() {
15695
+ this.slideHeight = this._sideContentRef.nativeElement.clientHeight;
15696
+ }
15697
+ _calculateSideContentWidth() {
15698
+ const slidePanelWidth = this._slidePanelRef.nativeElement.getBoundingClientRect().width;
15699
+ const slideContentWidth = this._slideContentRef.nativeElement.getBoundingClientRect().width;
15700
+ this.sideContentWidth = slidePanelWidth - slideContentWidth;
15701
+ }
15702
+ };
15703
+ SlidePanelComponent.nextId = 0;
15704
+ SlidePanelComponent.ctorParameters = () => [
15705
+ { type: SlidePanelService }
15706
+ ];
15707
+ __decorate([
15708
+ Input()
15709
+ ], SlidePanelComponent.prototype, "id", void 0);
15710
+ __decorate([
15711
+ Input()
15712
+ ], SlidePanelComponent.prototype, "openIcon", void 0);
15713
+ __decorate([
15714
+ Input()
15715
+ ], SlidePanelComponent.prototype, "closeIcon", void 0);
15716
+ __decorate([
15717
+ Input()
15718
+ ], SlidePanelComponent.prototype, "cache", void 0);
15719
+ __decorate([
15720
+ Input()
15721
+ ], SlidePanelComponent.prototype, "createOpen", void 0);
15722
+ __decorate([
15723
+ Output()
15724
+ ], SlidePanelComponent.prototype, "panelOpened", void 0);
15725
+ __decorate([
15726
+ Output()
15727
+ ], SlidePanelComponent.prototype, "panelClosed", void 0);
15728
+ __decorate([
15729
+ ViewChild("slidePanel")
15730
+ ], SlidePanelComponent.prototype, "_slidePanelRef", void 0);
15731
+ __decorate([
15732
+ ViewChild("slideContent")
15733
+ ], SlidePanelComponent.prototype, "_slideContentRef", void 0);
15734
+ __decorate([
15735
+ ViewChild("sideContent")
15736
+ ], SlidePanelComponent.prototype, "_sideContentRef", void 0);
15737
+ __decorate([
15738
+ HostListener("window:resize")
15739
+ ], SlidePanelComponent.prototype, "onResize", null);
15740
+ SlidePanelComponent = SlidePanelComponent_1 = __decorate([
15741
+ Component({
15742
+ selector: "s-slide-panel",
15743
+ template: "<div #slidePanel class=\"slide-panel\">\n <div\n #slideContent\n class=\"slide-content\"\n [ngClass]=\"{\n 'slide-content--closed': !isOpen,\n 'slide-content--over': isSlideOver\n }\">\n <div\n #mainContainer\n class=\"main-container\"\n [style.maxHeight]=\"slideHeight + 'px'\">\n <ng-container *ngIf=\"cache; then cacheTemplate else cachelessTemplate\"></ng-container>\n </div>\n <button\n class=\"button\"\n [ngClass]=\"isOpen ? closeIcon : openIcon\"\n (click)=\"onClickButton()\">\n </button>\n </div>\n <div \n #sideContent\n class=\"side-content\"\n [ngStyle]=\"{ 'width.px': sideContentWidth }\">\n <ng-content select=\"[side-content]\"></ng-content>\n </div>\n</div>\n\n<ng-template #cacheTemplate>\n <div\n class=\"content-container\"\n [@cacheAnimation]=\"isOpen\"\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cacheAnimation.start)=\"onContentAnimationStart()\"\n (@cacheAnimation.done)=\"onContentAnimationDone()\">\n <ng-container [ngTemplateOutlet]=\"slideContentTemplate\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #cachelessTemplate>\n <div\n *ngIf=\"isOpen\"\n class=\"content-container\"\n @cachelessAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cachelessAnimation.start)=\"onContentAnimationStart()\"\n (@cachelessAnimation.done)=\"onContentAnimationDone()\">\n <ng-container [ngTemplateOutlet]=\"slideContentTemplate\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #slideContentTemplate>\n <ng-content select=\"[slide-content]\"></ng-content>\n</ng-template>",
15744
+ animations: [
15745
+ trigger("cachelessAnimation", [
15746
+ transition(":enter", [
15747
+ style$7({ width: "0" }),
15748
+ animate("200ms linear", style$7({ width: "*" })),
15749
+ ]),
15750
+ transition(":leave", [
15751
+ style$7({ width: "*" }),
15752
+ animate("200ms linear", style$7({ width: "0" })),
15753
+ ]),
15754
+ ]),
15755
+ trigger("cacheAnimation", [
15756
+ state("true", style$7({ width: "*", padding: '0 16px' })),
15757
+ state("false", style$7({ width: '0px', padding: '0' })),
15758
+ transition("* => *", animate("200ms")),
15759
+ ]),
15760
+ ],
15761
+ styles: [".slide-panel{display:-ms-flexbox;display:flex;width:100%}.slide-panel .slide-content{display:-ms-flexbox;display:flex;position:relative}.slide-panel .slide-content .main-container{background-color:#eeebf2;display:-ms-flexbox;display:flex;border:1px solid #ccc;overflow:hidden;position:relative}.slide-panel .slide-content .main-container .content-container{overflow-y:auto;overflow-x:hidden;padding:16px}.slide-panel .slide-content .button{-ms-flex-align:center;align-items:center;background-color:#eeebf2;border:1px solid #ccc;border-left:none;border-radius:0 4px 4px 0;cursor:pointer;display:-ms-flexbox;display:flex;font-family:\"Font Awesome 5 Pro\";font-size:16px;height:32px;-ms-flex-pack:center;justify-content:center;position:absolute;right:-32px;top:16px;width:32px;z-index:99}.slide-panel .slide-content--closed .main-container{border:none}.slide-panel .slide-content--over{position:absolute}.slide-panel .side-content{display:-ms-flexbox;display:flex;height:-webkit-max-content;height:max-content;overflow:auto;transition:width .1s linear}"]
15762
+ })
15763
+ ], SlidePanelComponent);
15764
+
15765
+ let SlidePanelModule = class SlidePanelModule {
15766
+ };
15767
+ SlidePanelModule = __decorate([
15768
+ NgModule({
15769
+ imports: [CommonModule],
15770
+ declarations: [SlidePanelComponent],
15771
+ exports: [SlidePanelComponent],
15772
+ providers: [SlidePanelService],
15773
+ })
15774
+ ], SlidePanelModule);
15775
+
15776
+ var SplitButtonType;
15777
+ (function (SplitButtonType) {
15778
+ SplitButtonType["Primary"] = "primary";
15779
+ SplitButtonType["Secondary"] = "secondary";
15780
+ SplitButtonType["Default"] = "default";
15781
+ })(SplitButtonType || (SplitButtonType = {}));
15782
+
15783
+ let SplitButtonComponent = class SplitButtonComponent {
15784
+ constructor(eRef) {
15785
+ this.eRef = eRef;
15786
+ this.disabled = false;
15787
+ this.type = SplitButtonType.Primary;
15788
+ this.buttonClicked = new EventEmitter();
15789
+ this.open = false;
15790
+ }
15791
+ onClickout(event) {
15792
+ if (!this.eRef.nativeElement.contains(event.target)) {
15793
+ this.closeDropdown();
15543
15794
  }
15544
15795
  }
15545
- _setMenuPosition(position) {
15546
- var _a, _b;
15547
- const ITEM_HEIGHT = 37;
15548
- const DIVIDER_HEIGHT = 5;
15549
- const PADDING = 8;
15550
- if (this._componentRef !== null) {
15551
- const { top, right, bottom, left } = position;
15552
- const itemsCount = (_a = this._componentRef.instance.items) === null || _a === void 0 ? void 0 : _a.reduce((count, item) => {
15553
- return !item.divider ? count + 1 : count;
15554
- }, 0);
15555
- const dividersCount = (_b = this._componentRef.instance.items) === null || _b === void 0 ? void 0 : _b.reduce((count, item) => {
15556
- return item.divider ? count + 1 : count;
15557
- }, 0);
15558
- // I need to calculate the height of the component because the internal elements have not been created yet.
15559
- const menuHeight = itemsCount * ITEM_HEIGHT + dividersCount * DIVIDER_HEIGHT + PADDING + 8;
15560
- const menuWidth = this._menuDivElement.getBoundingClientRect().width;
15561
- const rightFreeSpace = window.innerWidth - right;
15562
- const bottomFreeSpace = window.innerHeight - bottom;
15563
- if (rightFreeSpace > menuWidth) {
15564
- this._componentRef.instance.left = right;
15565
- }
15566
- else {
15567
- this._componentRef.instance.left = left - menuWidth;
15568
- }
15569
- if (bottomFreeSpace <= menuHeight) {
15570
- this._componentRef.instance.top = Math.max(window.innerHeight - menuHeight, window.scrollY);
15571
- }
15572
- else {
15573
- this._componentRef.instance.top = window.scrollY + top;
15574
- }
15796
+ onButtonClick() {
15797
+ if (!this.disabled) {
15798
+ this.buttonClicked.emit();
15799
+ this.closeDropdown();
15575
15800
  }
15576
15801
  }
15577
- _subscribeEvents() {
15578
- // Increment current item event.
15579
- this._tieredMenuEventService.incrementCurrentItemEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
15580
- this._incrementCurItem();
15581
- });
15582
- // Decrement current item event.
15583
- this._tieredMenuEventService.decrementCurrentItemEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
15584
- this._decrementCurItem();
15585
- });
15586
- // Select item event.
15587
- this._tieredMenuEventService.selectItemEvent.pipe(takeUntil(this._unsubscribe$)).subscribe((item) => {
15588
- if (item.submenu) {
15589
- this._tieredMenuEventService.openItemMenuEvent.emit(item);
15590
- }
15591
- else if (item.command) {
15592
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15593
- item.command();
15594
- }
15595
- });
15596
- // Close all menus event.
15597
- this._tieredMenuEventService.closeAllMenusEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
15598
- this._destroy();
15599
- this.tieredMenuService.currentItem = null;
15600
- this.tieredMenuService.currentItems = this.tieredMenuService.items;
15601
- this.tieredMenuService.markAllItemsAsClosed(this.tieredMenuService.items);
15602
- });
15603
- // Open item menu event.
15604
- this._tieredMenuEventService.openItemMenuEvent.pipe(takeUntil(this._unsubscribe$)).subscribe((item) => {
15605
- if (this.tieredMenuService.currentItem) {
15606
- if (this.tieredMenuService.currentItem.parent === item) {
15607
- return;
15608
- }
15609
- if (!this.tieredMenuService.searchTheHierarchy(this.tieredMenuService.currentItem.parent, item)) {
15610
- let current = this.tieredMenuService.currentItem;
15611
- current.isOpen = false;
15612
- while ((current === null || current === void 0 ? void 0 : current.parent) !== item.parent) {
15613
- this._tieredMenuEventService.closeItemMenuEvent.emit(current);
15614
- this._changeDetectorRef.detectChanges();
15615
- current = current.parent;
15616
- }
15617
- if (current) {
15618
- current.isOpen = false;
15619
- }
15620
- }
15621
- }
15622
- if (item.submenu && !item.isOpen && this.items.includes(item)) {
15623
- const { top, right, left, bottom } = document.querySelector(`#${item.id}`).getBoundingClientRect();
15624
- const position = { top, right, left, bottom };
15625
- this._createMenu(item.submenu, position);
15626
- this.tieredMenuService.currentItems = item.submenu;
15627
- this.tieredMenuService.currentItem = item.submenu[0];
15628
- item.isOpen = true;
15629
- }
15630
- });
15631
- // Close item menu event.
15632
- this._tieredMenuEventService.closeItemMenuEvent
15633
- .pipe(takeUntil(this._unsubscribe$))
15634
- .subscribe((item) => {
15635
- var _a, _b;
15636
- if (this.items.some((i) => i.id === item.id)) {
15637
- if (item.parent) {
15638
- item.parent.isOpen = false;
15639
- }
15640
- 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;
15641
- this.tieredMenuService.currentItem = item.parent;
15642
- this.destroyRequest.emit(false);
15643
- }
15644
- });
15802
+ onDropdownClick() {
15803
+ if (!this.disabled) {
15804
+ this.open = !this.open;
15805
+ }
15645
15806
  }
15646
- };
15647
- TieredMenuComponent.ctorParameters = () => [
15648
- { type: ApplicationRef },
15649
- { type: ComponentFactoryResolver },
15650
- { type: Injector },
15651
- { type: ChangeDetectorRef },
15652
- { type: TieredMenuService },
15653
- { type: TieredMenuEventService }
15807
+ onOptionClick(option) {
15808
+ option.action && option.action();
15809
+ this.closeDropdown();
15810
+ }
15811
+ closeDropdown() {
15812
+ this.open = false;
15813
+ }
15814
+ };
15815
+ SplitButtonComponent.ctorParameters = () => [
15816
+ { type: ElementRef }
15654
15817
  ];
15655
15818
  __decorate([
15656
- Output()
15657
- ], TieredMenuComponent.prototype, "destroyRequest", void 0);
15819
+ Input()
15820
+ ], SplitButtonComponent.prototype, "disabled", void 0);
15658
15821
  __decorate([
15659
- HostListener("window:resize")
15660
- ], TieredMenuComponent.prototype, "onResize", null);
15822
+ Input()
15823
+ ], SplitButtonComponent.prototype, "iconClass", void 0);
15661
15824
  __decorate([
15662
- HostListener("document:click", ["$event"])
15663
- ], TieredMenuComponent.prototype, "onDocumentClick", null);
15825
+ Input()
15826
+ ], SplitButtonComponent.prototype, "label", void 0);
15664
15827
  __decorate([
15665
- HostListener("document:keydown", ["$event"])
15666
- ], TieredMenuComponent.prototype, "onKeydownHandler", null);
15667
- TieredMenuComponent = TieredMenuComponent_1 = __decorate([
15828
+ Input()
15829
+ ], SplitButtonComponent.prototype, "type", void 0);
15830
+ __decorate([
15831
+ Input()
15832
+ ], SplitButtonComponent.prototype, "options", void 0);
15833
+ __decorate([
15834
+ Output()
15835
+ ], SplitButtonComponent.prototype, "buttonClicked", void 0);
15836
+ __decorate([
15837
+ HostListener("document:click", ["$event"])
15838
+ ], SplitButtonComponent.prototype, "onClickout", null);
15839
+ SplitButtonComponent = __decorate([
15668
15840
  Component({
15669
- selector: "s-tiered-menu",
15670
- template: "<div\n class=\"menu\"\n [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.visible && !item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [highlight]=\"item.isOpen\"\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>",
15671
- 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;max-height:100vh;min-width:176px;padding:4px 0;overflow-y:auto;position:absolute;z-index:9999}"]
15841
+ selector: "s-split-button",
15842
+ template: "<div class=\"split-button\" [ngClass]=\"{\n 'split-button--primary': type == 'primary',\n 'split-button--secondary': type == 'secondary',\n 'split-button--default': type == 'default',\n 'split-button--disabled': disabled\n }\">\n <button class=\"button\" (click)=\"onButtonClick()\">\n <span class=\"button__icon\" [ngClass]=\"iconClass\"></span>\n <span class=\"button__label\">{{ label }}</span>\n </button>\n <button class=\"dropdown\" (click)=\"onDropdownClick()\">\n <span class=\"dropdown__icon\" [ngClass]=\"{\n 'far': true,\n 'fa-chevron-down': !open,\n 'fa-chevron-up': open\n }\">\n </span>\n </button>\n</div>\n\n<ul *ngIf=\"this.open\" class=\"options\">\n <li *ngFor=\"let option of options\" (click)=\"onOptionClick(option)\">\n {{ option.title }}\n </li>\n</ul>",
15843
+ styles: [".split-button{display:-ms-flexbox;display:flex;-webkit-user-select:none;-ms-user-select:none;user-select:none}.split-button .button{-ms-flex-align:center;align-items:center;border:none;border-radius:4px 0 0 4px;display:-ms-flexbox;display:flex;padding:8px 8px 8px 12px;transition:.3s ease-in-out}.split-button .button__icon{font-size:16px;padding:0 4px}.split-button .button__title{font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:21px}.split-button .dropdown{-ms-flex-align:center;align-items:center;border:none;border-left:1px solid #608190;border-radius:0 4px 4px 0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding:12px 8px;transition:.3s ease-in-out}.split-button--disabled{opacity:.5}.split-button--primary .button,.split-button--primary .dropdown{background-color:#428bca;color:#fff}.split-button--primary:not(.split-button--primary--disabled) .button,.split-button--primary:not(.split-button--primary--disabled) .dropdown{cursor:pointer}.split-button--primary:not(.split-button--primary--disabled) .button:hover,.split-button--primary:not(.split-button--primary--disabled) .dropdown:hover{background-color:#063951}.split-button--secondary .button,.split-button--secondary .dropdown{background-color:#7892a1;color:#fff}.split-button--secondary:not(.split-button--secondary--disabled) .button,.split-button--secondary:not(.split-button--secondary--disabled) .dropdown{cursor:pointer}.split-button--secondary:not(.split-button--secondary--disabled) .button:hover,.split-button--secondary:not(.split-button--secondary--disabled) .dropdown:hover{background-color:#697882}.split-button--default .button,.split-button--default .dropdown{background-color:unset;border:1px solid #d8d8d8;color:#333}.split-button--default:not(.split-button--default--disabled) .button,.split-button--default:not(.split-button--default--disabled) .dropdown{cursor:pointer}.split-button--default:not(.split-button--default--disabled) .button:hover,.split-button--default:not(.split-button--default--disabled) .dropdown:hover{background-color:#d8d8d8}.options{background-color:#fff;border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.25);display:inline-block;list-style:none;margin:2px 0;padding:8px 0;position:absolute;-webkit-user-select:none;-ms-user-select:none;user-select:none}.options li{color:#333;cursor:pointer;font-family:\"Open Sans\",sans-serif;font-weight:400;font-size:14px;line-height:21px;padding:8px 16px}.options li:hover{background-color:#d8d8d8}"]
15672
15844
  })
15673
- ], TieredMenuComponent);
15845
+ ], SplitButtonComponent);
15674
15846
 
15675
- let TieredMenuGlobalService = class TieredMenuGlobalService {
15847
+ let SplitButtonModule = class SplitButtonModule {
15676
15848
  };
15677
- TieredMenuGlobalService = __decorate([
15678
- Injectable()
15679
- ], TieredMenuGlobalService);
15849
+ SplitButtonModule = __decorate([
15850
+ NgModule({
15851
+ imports: [CommonModule],
15852
+ declarations: [SplitButtonComponent],
15853
+ exports: [SplitButtonComponent],
15854
+ })
15855
+ ], SplitButtonModule);
15680
15856
 
15681
- let TieredMenuDirective = class TieredMenuDirective {
15682
- constructor(_elementRef, _appRef, _componentFactoryResolver, _injector, _tieredMenuEventService, _tieredMenuService, _tieredMenuGlobalService, _changeDetectorRef) {
15683
- this._elementRef = _elementRef;
15684
- this._appRef = _appRef;
15685
- this._componentFactoryResolver = _componentFactoryResolver;
15686
- this._injector = _injector;
15687
- this._tieredMenuEventService = _tieredMenuEventService;
15688
- this._tieredMenuService = _tieredMenuService;
15689
- this._tieredMenuGlobalService = _tieredMenuGlobalService;
15690
- this._changeDetectorRef = _changeDetectorRef;
15691
- this.items = [];
15692
- this.triggerEvent = "click";
15693
- this._componentRef = null;
15694
- this._isNested = false;
15695
- this._isOpen = false;
15696
- this._unsubscribe$ = new Subject();
15697
- }
15698
- onClick(event) {
15699
- if (this.triggerEvent === "click" && !this._isOpen) {
15700
- this._lastActiveElement = document.activeElement;
15701
- this._createMenu();
15702
- event.preventDefault();
15703
- event.stopPropagation();
15704
- }
15705
- }
15706
- ngOnInit() {
15707
- this._subscribeEvents();
15708
- }
15709
- ngDoCheck() {
15710
- if (!this.previousItems) {
15711
- this.previousItems = this._tieredMenuService.cloneItems(this.items);
15712
- }
15713
- let hasChanges = false;
15714
- if (this.items.length !== this.previousItems.length) {
15715
- hasChanges = true;
15716
- }
15717
- else {
15718
- for (let i = 0; i < this.items.length; i++) {
15719
- if (!this._compareItems(this.items[i], this.previousItems[i])) {
15720
- hasChanges = true;
15721
- break;
15722
- }
15723
- }
15724
- }
15725
- if (hasChanges) {
15726
- this._updateServiceItems();
15727
- this._changeDetectorRef.detectChanges();
15728
- this._rebuildMenu();
15729
- }
15730
- this.previousItems = this._tieredMenuService.cloneItems(this.items);
15731
- }
15732
- ngOnDestroy() {
15733
- this._unsubscribe$.next();
15734
- this._unsubscribe$.complete();
15735
- this._destroy();
15736
- }
15737
- _createMenu() {
15738
- var _a, _b, _c;
15739
- this._updateServiceItems();
15740
- if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
15741
- (_b = this._tieredMenuGlobalService.lastInstance) === null || _b === void 0 ? void 0 : _b._destroy();
15742
- this._tieredMenuGlobalService.lastInstance = this;
15743
- (_c = this._lastActiveElement) === null || _c === void 0 ? void 0 : _c.blur();
15744
- this._isOpen = true;
15745
- this._isNested = document.body.clientWidth < 600;
15746
- this._isNested ? this._createNestedMenu() : this._createTieredMenu();
15747
- }
15748
- }
15749
- _createTieredMenu() {
15750
- var _a;
15751
- if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
15752
- const componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent);
15753
- this._componentRef = componentFactory.create(this._injector);
15754
- this._appRef.attachView(this._componentRef.hostView);
15755
- const domElem = this._componentRef.hostView.rootNodes[0];
15756
- document.body.appendChild(domElem);
15757
- this._setMenuComponentProperties();
15758
- this._componentRef.instance.destroyRequest.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
15759
- this._destroy();
15760
- });
15761
- this._setMenuPosition();
15762
- }
15857
+ var StatsCardComponent_1;
15858
+ let StatsCardComponent = StatsCardComponent_1 = class StatsCardComponent {
15859
+ constructor() {
15860
+ this.id = `s-stats-card-${StatsCardComponent_1.nextId++}`;
15861
+ this.alwaysWithBorder = false;
15862
+ this.lightVersion = false;
15863
+ this.lightMode = true;
15864
+ this.iconClass = "fa fa-bar-chart";
15865
+ this.color = "#339966";
15866
+ this.animateNumbers = true;
15867
+ this.clickable = false;
15868
+ this.tooltip = "";
15869
+ this.onClick = new EventEmitter();
15870
+ this.ANIMATION_DURATION_MS = 200;
15871
+ this.STEP_DURATION_MS = 20;
15872
+ this.previousValue = "0";
15873
+ this._value = "0";
15763
15874
  }
15764
- _createNestedMenu() {
15765
- var _a;
15766
- if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
15767
- const componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuNestedComponent);
15768
- this._componentRef = componentFactory.create(this._injector);
15769
- this._appRef.attachView(this._componentRef.hostView);
15770
- const domElem = this._componentRef.hostView.rootNodes[0];
15771
- document.body.appendChild(domElem);
15772
- this._setMenuComponentProperties();
15773
- this._setMenuPosition();
15774
- }
15875
+ set value(value) {
15876
+ this.previousValue = this._value;
15877
+ this._value = String(value);
15878
+ if (this.animateNumbers)
15879
+ this.updateDisplayValue();
15880
+ else
15881
+ this.displayValue = this.value;
15775
15882
  }
15776
- _destroy() {
15777
- if (this._componentRef) {
15778
- this._isOpen = false;
15779
- window.clearTimeout(this._showTimeout);
15780
- this._appRef.detachView(this._componentRef.hostView);
15781
- this._componentRef.destroy();
15782
- this._componentRef = null;
15783
- this._tieredMenuService.currentItems = this._tieredMenuService.items;
15784
- this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
15785
- this._tieredMenuEventService.closeAllMenusEvent.emit();
15786
- }
15883
+ get value() {
15884
+ return this._value;
15787
15885
  }
15788
- _setMenuPosition() {
15789
- var _a, _b;
15790
- const ITEM_HEIGHT = 37;
15791
- const ITEM_WIDTH = 176;
15792
- const DIVIDER_HEIGHT = 5;
15793
- const PADDING = 8;
15794
- const MARGIN = 4;
15795
- if (this._componentRef !== null) {
15796
- this._componentRef.instance.top = 8;
15797
- let { bottom, left, right } = this._elementRef.nativeElement.getBoundingClientRect();
15798
- const itemsCount = (_a = this._componentRef.instance.items) === null || _a === void 0 ? void 0 : _a.reduce((count, item) => {
15799
- return !item.divider ? count + 1 : count;
15800
- }, 0);
15801
- const dividersCount = (_b = this._componentRef.instance.items) === null || _b === void 0 ? void 0 : _b.reduce((count, item) => {
15802
- return item.divider ? count + 1 : count;
15803
- }, 0);
15804
- const menuHeight = itemsCount * ITEM_HEIGHT + dividersCount * DIVIDER_HEIGHT + PADDING + MARGIN;
15805
- const rightFreeSpace = window.innerWidth - right;
15806
- const bottomFreeSpace = window.innerHeight - bottom;
15807
- this._componentRef.instance.top = bottom;
15808
- this._componentRef.instance.left = left;
15809
- if (bottomFreeSpace <= menuHeight) {
15810
- this._componentRef.instance.top = Math.max(scrollY + bottom - menuHeight, 0);
15811
- }
15812
- else {
15813
- this._componentRef.instance.top = window.scrollY + bottom + MARGIN;
15886
+ updateDisplayValue() {
15887
+ const animationDuration = new BigNumber$1(this.ANIMATION_DURATION_MS);
15888
+ const stepDuration = new BigNumber$1(this.STEP_DURATION_MS);
15889
+ const animationCount = animationDuration.dividedBy(stepDuration);
15890
+ const previousRawValue = new BigNumber$1(this.previousValue.replace(/\D/g, ""));
15891
+ const rawValue = new BigNumber$1(this.value.replace(/\D/g, ""));
15892
+ const incrementValue = rawValue.minus(previousRawValue).absoluteValue().dividedBy(animationCount);
15893
+ const incremental = previousRawValue.isLessThan(rawValue);
15894
+ clearInterval(this.intervalId);
15895
+ this.displayValue = this.replaceNumericPositions(this.value);
15896
+ let counter = previousRawValue;
15897
+ this.intervalId = setInterval(() => {
15898
+ if (incremental && counter.isLessThan(rawValue)) {
15899
+ this.displayValue = this.replaceNumericPositions(this.displayValue, counter);
15900
+ counter = counter.plus(incrementValue);
15814
15901
  }
15815
- if (rightFreeSpace > 176) {
15816
- this._componentRef.instance.left = window.scrollX + left;
15902
+ else if (!incremental && counter.isGreaterThan(rawValue)) {
15903
+ this.displayValue = this.replaceNumericPositions(this.displayValue, counter);
15904
+ counter = counter.minus(incrementValue);
15817
15905
  }
15818
15906
  else {
15819
- this._componentRef.instance.left = window.scrollX + right - ITEM_WIDTH;
15820
- }
15821
- if (this._isNested) {
15822
- this._componentRef.instance.left = MARGIN;
15823
- }
15824
- }
15825
- }
15826
- _setMenuComponentProperties() {
15827
- if (this._componentRef != null) {
15828
- this._componentRef.instance.items = this._tieredMenuService.items;
15829
- }
15830
- }
15831
- _subscribeEvents() {
15832
- this._tieredMenuEventService.closeAllMenusEvent.pipe(takeUntil(this._unsubscribe$)).subscribe(() => {
15833
- this._tieredMenuService.items = this._tieredMenuService.markAllItemsAsClosed(this._tieredMenuService.items);
15834
- this._destroy();
15835
- });
15836
- }
15837
- _compareItems(item1, item2) {
15838
- return JSON.stringify(item1) === JSON.stringify(item2);
15839
- }
15840
- _rebuildMenu() {
15841
- this._destroy();
15907
+ this.displayValue = this.value;
15908
+ clearInterval(this.intervalId);
15909
+ }
15910
+ }, this.STEP_DURATION_MS);
15842
15911
  }
15843
- _updateServiceItems() {
15844
- this._tieredMenuService.items = this._tieredMenuService.normalizeData(this.items);
15845
- this._tieredMenuService.currentItems = this._tieredMenuService.items;
15846
- this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
15912
+ replaceNumericPositions(value, newValue) {
15913
+ const rawValue = value.replace(/[^\d]/g, "");
15914
+ const newValueString = newValue ? newValue.toString() : "";
15915
+ const formattedNewValue = newValueString
15916
+ .toString()
15917
+ .replace(/\D/g, "")
15918
+ .padStart(rawValue.length, "0");
15919
+ let newValueIndex = 0;
15920
+ return value
15921
+ .split("")
15922
+ .map(char => {
15923
+ const number = Number(char);
15924
+ if (number || char === "0")
15925
+ return formattedNewValue[newValueIndex++];
15926
+ return char;
15927
+ })
15928
+ .join("");
15847
15929
  }
15848
15930
  };
15849
- TieredMenuDirective.ctorParameters = () => [
15850
- { type: ElementRef },
15851
- { type: ApplicationRef },
15852
- { type: ComponentFactoryResolver },
15853
- { type: Injector },
15854
- { type: TieredMenuEventService },
15855
- { type: TieredMenuService },
15856
- { type: TieredMenuGlobalService },
15857
- { type: ChangeDetectorRef }
15858
- ];
15931
+ StatsCardComponent.nextId = 0;
15859
15932
  __decorate([
15860
15933
  Input()
15861
- ], TieredMenuDirective.prototype, "items", void 0);
15934
+ ], StatsCardComponent.prototype, "id", void 0);
15862
15935
  __decorate([
15863
15936
  Input()
15864
- ], TieredMenuDirective.prototype, "triggerEvent", void 0);
15937
+ ], StatsCardComponent.prototype, "label", void 0);
15865
15938
  __decorate([
15866
- HostListener("click", ["$event"])
15867
- ], TieredMenuDirective.prototype, "onClick", null);
15868
- TieredMenuDirective = __decorate([
15869
- Directive({
15870
- selector: "[sTieredMenu]",
15871
- providers: [TieredMenuEventService, TieredMenuService],
15872
- })
15873
- ], TieredMenuDirective);
15874
-
15875
- let TieredMenuDividerComponent = class TieredMenuDividerComponent {
15876
- };
15877
- TieredMenuDividerComponent = __decorate([
15878
- Component({
15879
- selector: "s-tiered-menu-divider",
15880
- template: "<div class=\"divider\"></div>",
15881
- styles: [".divider{margin:2px 0;height:1px;background-color:#ccc}"]
15882
- })
15883
- ], TieredMenuDividerComponent);
15884
-
15885
- let TieredMenuItemComponent = class TieredMenuItemComponent {
15886
- constructor(_tieredMenuEventService) {
15887
- this._tieredMenuEventService = _tieredMenuEventService;
15888
- this.focused = false;
15889
- this.highlight = false;
15890
- this.triggerEvent = "click";
15891
- this.closeOnClick = false;
15892
- }
15893
- onClick() {
15894
- if (this.item.disabled)
15895
- return;
15896
- if (this.item.submenu) {
15897
- if (!this.item.isOpen) {
15898
- this._tieredMenuEventService.openItemMenuEvent.emit(this.item);
15899
- }
15900
- else if (this.closeOnClick) {
15901
- this._tieredMenuEventService.closeItemMenuEvent.emit(this.item);
15902
- }
15903
- }
15904
- else {
15905
- this._tieredMenuEventService.selectItemEvent.emit(this.item);
15906
- }
15907
- }
15908
- onMouseEnter() {
15909
- if (this.item.disabled)
15910
- return;
15911
- if (this.triggerEvent === "hover" && !this.item.isOpen) {
15912
- this._showTimeout = window.setTimeout(() => {
15913
- this._tieredMenuEventService.openItemMenuEvent.emit(this.item);
15914
- }, 300);
15915
- }
15916
- }
15917
- onMouseLeave() {
15918
- window.clearTimeout(this._showTimeout);
15919
- }
15920
- };
15921
- TieredMenuItemComponent.ctorParameters = () => [
15922
- { type: TieredMenuEventService }
15923
- ];
15939
+ Input()
15940
+ ], StatsCardComponent.prototype, "alwaysWithBorder", void 0);
15924
15941
  __decorate([
15925
15942
  Input()
15926
- ], TieredMenuItemComponent.prototype, "item", void 0);
15943
+ ], StatsCardComponent.prototype, "lightVersion", void 0);
15927
15944
  __decorate([
15928
15945
  Input()
15929
- ], TieredMenuItemComponent.prototype, "focused", void 0);
15946
+ ], StatsCardComponent.prototype, "lightMode", void 0);
15930
15947
  __decorate([
15931
15948
  Input()
15932
- ], TieredMenuItemComponent.prototype, "highlight", void 0);
15949
+ ], StatsCardComponent.prototype, "iconClass", void 0);
15933
15950
  __decorate([
15934
15951
  Input()
15935
- ], TieredMenuItemComponent.prototype, "triggerEvent", void 0);
15952
+ ], StatsCardComponent.prototype, "color", void 0);
15936
15953
  __decorate([
15937
15954
  Input()
15938
- ], TieredMenuItemComponent.prototype, "closeOnClick", void 0);
15955
+ ], StatsCardComponent.prototype, "animateNumbers", void 0);
15939
15956
  __decorate([
15940
- HostListener("click"),
15941
- HostListener("touchend")
15942
- ], TieredMenuItemComponent.prototype, "onClick", null);
15957
+ Input()
15958
+ ], StatsCardComponent.prototype, "clickable", void 0);
15943
15959
  __decorate([
15944
- HostListener("mouseenter")
15945
- ], TieredMenuItemComponent.prototype, "onMouseEnter", null);
15960
+ Input()
15961
+ ], StatsCardComponent.prototype, "value", null);
15946
15962
  __decorate([
15947
- HostListener("mouseleave")
15948
- ], TieredMenuItemComponent.prototype, "onMouseLeave", null);
15949
- TieredMenuItemComponent = __decorate([
15963
+ Input()
15964
+ ], StatsCardComponent.prototype, "tooltip", void 0);
15965
+ __decorate([
15966
+ Output()
15967
+ ], StatsCardComponent.prototype, "onClick", void 0);
15968
+ StatsCardComponent = StatsCardComponent_1 = __decorate([
15950
15969
  Component({
15951
- selector: "s-tiered-menu-item",
15952
- 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 'tiered-menu-item--disabled': item.disabled\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>",
15953
- 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}.tiered-menu-item--disabled{opacity:50%;cursor:default}"]
15970
+ selector: "s-stats-card",
15971
+ template: "<div\n [id]=\"id\"\n class=\"s-stats-card\"\n [ngClass]=\"{\n 's-stats-card--always-border': alwaysWithBorder,\n 's-stats-card--light': lightMode,\n 's-stats-card--color': !lightMode,\n 's-stats-card--light-version': lightVersion,\n 's-stats-card--clickable': clickable\n }\"\n (click)=\"clickable && onClick.next($event)\">\n\n <div\n [id]=\"id + '-background'\"\n class=\"s-stats-card-background\"\n [ngStyle]=\"{ 'background-color': !lightMode && color || '' }\">\n </div>\n <div\n [id]=\"id + '-overlay'\"\n class=\"s-stats-card-overlay\">\n </div>\n\n <div\n [id]=\"id + '-info-container'\"\n class=\"s-stats-card-info-container\">\n <div class=\"s-stats-card-info-inner-container\">\n <div\n [id]=\"id + '-icon-container'\"\n class=\"s-stats-card-icon-container\"\n [ngStyle]=\"{ 'background-color': lightMode && color || '' }\">\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n [ngClass]=\"{ 's-stats-card-icon': true }\"\n [ngStyle]=\"{'color': !lightMode && color || ''}\"\n aria-hidden=\"true\"></span>\n </div>\n\n <div\n [id]=\"id + '-text-container'\"\n class=\"s-stats-card-text-container\">\n <h4\n [id]=\"id + '-label'\"\n class=\"s-stats-card-label\"\n [pTooltip]=\"label\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n {{ label }}\n </h4>\n <span\n [id]=\"id + '-value'\"\n class=\"s-stats-card-value\"\n [pTooltip]=\"displayValue\"\n tooltipPosition=\"top\"\n showDelay=\"500\">\n {{ displayValue }}\n </span>\n </div>\n </div>\n <div class=\"s-stats-card-content-inner-container\">\n <div #content class=\"s-stats-card-content-container\">\n <ng-content></ng-content>\n </div>\n <div\n *ngIf=\"content.children.length\"\n class=\"s-stats-card-content-separator\">\n </div>\n </div>\n <span\n *ngIf=\"tooltip\"\n class=\"s-status-card-tooltip\"\n [pTooltip]=\"tooltip\"\n tooltipPosition=\"right\">\n <i class=\"fa fa-info-circle s-status-card-tooltip-icon\"></i>\n </span>\n </div>\n</div>\n",
15972
+ encapsulation: ViewEncapsulation.None,
15973
+ styles: ["s-stats-card{display:block;height:auto;position:relative}s-stats-card .s-stats-card{border:1px solid transparent;min-width:120px;overflow:hidden;position:relative}s-stats-card .s-stats-card .s-stats-card-background,s-stats-card .s-stats-card .s-stats-card-overlay{height:calc(100% - 2px);left:1px;position:absolute;top:1px;width:calc(100% - 2px)}s-stats-card .s-stats-card .s-stats-card-background{background-color:#fff}s-stats-card .s-stats-card .s-stats-card-overlay{background-color:#000;opacity:0;transition:opacity .2s ease-out}s-stats-card .s-stats-card .s-stats-card-info-container{overflow:auto;padding:15px;position:relative}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container{overflow:hidden;position:relative}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-icon-container{float:left;font-size:24px;height:50px;line-height:50px;text-align:center;transition:width .2s ease-out;width:50px}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container{-ms-flex-align:start;align-items:flex-start;color:#fff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;float:left;height:50px;-ms-flex-pack:center;justify-content:center;max-width:calc(100% - 65px);padding-left:15px}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-label{font-weight:400;width:100%}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-value{display:inline-block;font-size:20px;font-weight:700;width:100%}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container,s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-label,s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-content-inner-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-content-inner-container .s-stats-card-content-separator{border-top:1px solid #ccc;margin:15px 0;-ms-flex-order:1;order:1}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-content-inner-container .s-stats-card-content-container{-ms-flex-order:2;order:2}s-stats-card .s-stats-card .s-stats-card-info-container .s-status-card-tooltip{font-size:1rem;line-height:0;margin:.3rem;position:absolute;right:0;top:0}s-stats-card .s-stats-card .s-stats-card-info-container .s-status-card-tooltip .s-status-card-tooltip-icon{color:#fff}s-stats-card .s-stats-card.s-stats-card--color .s-stats-card-icon-container{background-color:#fff}s-stats-card .s-stats-card.s-stats-card--light *{color:#333}s-stats-card .s-stats-card.s-stats-card--light .s-stats-card-icon{color:#fff}s-stats-card .s-stats-card.s-stats-card--light * .s-status-card-tooltip .s-status-card-tooltip-icon,s-stats-card .s-stats-card.s-stats-card--light .s-stats-card-label{color:#999}s-stats-card .s-stats-card.s-stats-card--light-version .s-stats-card-info-inner-container .s-stats-card-icon-container{height:100%;left:0;position:absolute;right:0;width:10px}s-stats-card .s-stats-card.s-stats-card--light-version .s-stats-card-info-inner-container .s-stats-card-icon-container .s-stats-card-icon{display:none}s-stats-card .s-stats-card.s-stats-card--light-version .s-stats-card-info-inner-container .s-stats-card-text-container{height:auto;max-width:calc(100% - 25px);padding-left:25px}s-stats-card .s-stats-card.s-stats-card--clickable{cursor:pointer}s-stats-card .s-stats-card:hover .s-stats-card-overlay{opacity:.2}s-stats-card .s-stats-card.s-stats-card--light:hover .s-stats-card-overlay{opacity:.08}s-stats-card .s-stats-card.s-stats-card--light{border-color:#ccc}.s-sidebar-content .s-stats-card.s-stats-card--light:not(.s-stats-card--always-border),.ui-dialog-content .s-stats-card.s-stats-card--light:not(.s-stats-card--always-border),p-panel .s-stats-card.s-stats-card--light:not(.s-stats-card--always-border){border-color:transparent}@media (max-width:767px){s-stats-card .s-stats-card{height:auto}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-icon-container{height:100%;left:0;position:absolute;right:0;width:10px}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-icon-container .s-stats-card-icon{display:none}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container{height:auto;max-width:calc(100% - 25px);padding-left:25px}s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container,s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-label,s-stats-card .s-stats-card .s-stats-card-info-container .s-stats-card-info-inner-container .s-stats-card-text-container .s-stats-card-value{overflow:visible;white-space:normal;word-break:break-all}}"]
15954
15974
  })
15955
- ], TieredMenuItemComponent);
15975
+ ], StatsCardComponent);
15956
15976
 
15957
- let TieredMenuModule = class TieredMenuModule {
15977
+ let StatsCardModule = class StatsCardModule {
15958
15978
  };
15959
- TieredMenuModule = __decorate([
15979
+ StatsCardModule = __decorate([
15960
15980
  NgModule({
15961
15981
  imports: [
15962
15982
  CommonModule,
15983
+ TooltipModule$1,
15963
15984
  ],
15964
15985
  declarations: [
15965
- TieredMenuDirective,
15966
- TieredMenuComponent,
15967
- TieredMenuNestedComponent,
15968
- TieredMenuItemComponent,
15969
- TieredMenuDividerComponent,
15986
+ StatsCardComponent,
15987
+ ],
15988
+ exports: [
15989
+ StatsCardComponent,
15970
15990
  ],
15971
- exports: [TieredMenuDirective],
15972
- providers: [TieredMenuGlobalService],
15973
15991
  })
15974
- ], TieredMenuModule);
15992
+ ], StatsCardModule);
15993
+
15994
+ var StepsComponent_1;
15995
+ var StepState;
15996
+ (function (StepState) {
15997
+ StepState["Default"] = "default";
15998
+ StepState["Success"] = "success";
15999
+ StepState["Warning"] = "warning";
16000
+ })(StepState || (StepState = {}));
16001
+ let StepsComponent = StepsComponent_1 = class StepsComponent {
16002
+ constructor() {
16003
+ this.id = `s-steps-${StepsComponent_1.nextId++}`;
16004
+ this.activeIndex = 0;
16005
+ this.stepSelected = new EventEmitter();
16006
+ }
16007
+ stepClick(step, index, event) {
16008
+ if (step.disabled || index == this.activeIndex)
16009
+ return;
16010
+ this.stepSelected.emit({ step, index, event });
16011
+ }
16012
+ get stepState() {
16013
+ return StepState;
16014
+ }
16015
+ barAnimation(index, activeIndex) {
16016
+ const visited = index < activeIndex;
16017
+ const activated = index === activeIndex;
16018
+ return visited || activated;
16019
+ }
16020
+ afterBarAnimation(index, activeIndex) {
16021
+ const visited = index < activeIndex;
16022
+ const activated = index === activeIndex - 1;
16023
+ return visited || activated;
16024
+ }
16025
+ get visibledStep() {
16026
+ return this.steps.filter((step) => !step.hidden);
16027
+ }
16028
+ };
16029
+ StepsComponent.nextId = 0;
16030
+ __decorate([
16031
+ Input()
16032
+ ], StepsComponent.prototype, "id", void 0);
16033
+ __decorate([
16034
+ Input()
16035
+ ], StepsComponent.prototype, "steps", void 0);
16036
+ __decorate([
16037
+ Input()
16038
+ ], StepsComponent.prototype, "activeIndex", void 0);
16039
+ __decorate([
16040
+ Output()
16041
+ ], StepsComponent.prototype, "stepSelected", void 0);
16042
+ StepsComponent = StepsComponent_1 = __decorate([
16043
+ Component({
16044
+ selector: "s-steps",
16045
+ template: "<div [id]=\"id\" class=\"s-steps-container\">\n <ng-container *ngFor=\"let step of visibledStep; let i = index; let isFirst = first; let isLast = last\">\n <div *ngIf=\"!isFirst\" class=\"s-step-progress-bar\"\n [@activeDesative]=\"barAnimation(i, activeIndex) ? 'active': 'desactive'\" [ngClass]=\"{\n 's-step-success': (step.state === stepState.Success),\n 's-step-warning': (step.state === stepState.Warning),\n 's-step-disabled': step.disabled,\n 's-step-visited': (i < activeIndex),\n 's-step-active': (i === activeIndex)\n }\"></div>\n <div [id]=\"id + '-step-' + (step.id || i)\" class=\"s-step-header\" (click)=\"stepClick(step, i, $event)\" role=\"tab\"\n tabindex=\"0\" [attr.aria-label]=\"step.ariaLabel || null\" [attr.aria-controls]=\"step.ariaControls\"\n [attr.aria-labelledby]=\"!step.ariaLabel ? 'step-label-' + i : null\" [attr.aria-posinset]=\"i + 1\"\n [attr.aria-setsize]=\"visibledStep.length\" [attr.aria-selected]=\"activeIndex == i\" [ngClass]=\"{\n 's-step-success': (step.state === stepState.Success),\n 's-step-warning': (step.state === stepState.Warning),\n 's-step-visited': (i < activeIndex),\n 's-step-active': (i === activeIndex),\n 's-step-previous': (i === activeIndex - 1)\n }\">\n <div *ngIf=\"!isFirst\"\n [@beforeActiveDesative]=\"barAnimation(i, activeIndex) ? 'active': 'desactive'\"\n class=\"s-step-progress-bar-before\" [ngClass]=\"{\n 's-step-success': (step.state === stepState.Success),\n 's-step-warning': (step.state === stepState.Warning),\n 's-step-disabled': step.disabled,\n 's-step-visited': (i < activeIndex),\n 's-step-active': (i === activeIndex)\n }\"></div>\n <div *ngIf=\"!isLast\"\n [@afterActiveDesative]=\"afterBarAnimation(i, activeIndex) ? 'active': 'desactive'\"\n class=\"s-step-progress-bar-after\" [ngClass]=\"{\n 's-step-success': (step.state === stepState.Success),\n 's-step-warning': (step.state === stepState.Warning),\n 's-step-disabled': visibledStep[i + 1].disabled,\n 's-step-visited': ((i + 1) < activeIndex),\n 's-step-active': (i === (activeIndex - 1))\n }\"></div>\n <div\n class=\"s-step-index\"\n [ngClass]=\"{'s-step-disabled': step.disabled}\"\n [pTooltip]=\"step.tooltip\"\n tooltipPosition=\"top\">\n <div class=\"s-step-index-content\">\n <span\n *ngIf=\"step.state !== stepState.Warning && (step.state == stepState.Success || activeIndex > i)\"\n class=\"fas fa-check\"\n aria-hidden=\"true\"\n [attr.aria-label]=\"i + 1\"></span>\n <span\n *ngIf=\"step.state == stepState.Warning\"\n class=\"fas fa-exclamation-triangle\"\n aria-hidden=\"true\"\n [attr.aria-label]=\"i + 1\"></span>\n <span\n *ngIf=\"step.state != stepState.Success && step.state != stepState.Warning && activeIndex <= i\">\n {{i + 1}}\n </span>\n </div>\n </div>\n <div\n [id]=\"'step-label-' + i\"\n class=\"s-step-label\"\n [ngClass]=\"{'s-step-disabled': step.disabled}\">\n <span>\n {{step.label}}\n </span>\n </div>\n </div>\n </ng-container>\n</div>\n",
16046
+ host: {
16047
+ "aria-orientation": "horizontal",
16048
+ role: "tablist",
16049
+ "tab-index": "0",
16050
+ },
16051
+ animations: [
16052
+ trigger("beforeActiveDesative", [
16053
+ state("active", style$7({
16054
+ "background-position": "left bottom",
16055
+ })),
16056
+ state("desactive", style$7({
16057
+ "background-position": "right bottom",
16058
+ })),
16059
+ transition("active => desactive", [animate("50ms 100ms linear")]),
16060
+ transition("desactive => active", [animate("50ms 250ms linear")]),
16061
+ ]),
16062
+ trigger("activeDesative", [
16063
+ state("active", style$7({
16064
+ "background-position": "left bottom",
16065
+ })),
16066
+ state("desactive", style$7({
16067
+ "background-position": "right bottom",
16068
+ })),
16069
+ transition("active => desactive", [animate("100ms 150ms linear")]),
16070
+ transition("desactive => active", [animate("100ms 150ms linear")]),
16071
+ ]),
16072
+ trigger("afterActiveDesative", [
16073
+ state("active", style$7({
16074
+ "background-position": "left bottom",
16075
+ })),
16076
+ state("desactive", style$7({
16077
+ "background-position": "right bottom",
16078
+ })),
16079
+ transition("active => desactive", [animate("50ms 250ms linear")]),
16080
+ transition("desactive => active", [animate("50ms 100ms linear")]),
16081
+ ]),
16082
+ ],
16083
+ styles: ["@keyframes scale-up-center{0%{transform:scale(.5)}100%{transform:scale(1)}}.s-steps-container{display:-ms-flexbox;display:flex;white-space:nowrap;-ms-flex-align:start;align-items:flex-start;overflow:hidden;padding:15px 10px}.s-step-header{box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;cursor:pointer;position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:66px}.s-step-header .s-step-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all;color:#999;font-size:14px;font-weight:400;padding-top:5px}.s-step-header .s-step-progress-bar-before{margin:0;position:absolute;top:20px;-ms-flex:auto;flex:auto;height:3px;overflow:hidden;width:calc(50% - 20px);background-color:#ccc;background-image:linear-gradient(to right,#7892a1 50%,#ccc 50%);background-position:right bottom;background-size:300% 100%;left:0}.s-step-header .s-step-progress-bar-before.s-step-active,.s-step-header .s-step-progress-bar-before.s-step-visited{background-position:left bottom}.s-step-header .s-step-progress-bar-after{margin:0;position:absolute;top:20px;-ms-flex:auto;flex:auto;height:3px;overflow:hidden;width:calc(50% - 20px);background-color:#ccc;background-image:linear-gradient(to right,#7892a1 50%,#ccc 50%);background-position:right bottom;background-size:300% 100%;right:0}.s-step-header .s-step-progress-bar-after.s-step-active,.s-step-header .s-step-progress-bar-after.s-step-visited{background-position:left bottom}.s-step-progress-bar{margin:0;position:relative;top:20px;-ms-flex:auto;flex:auto;height:3px;overflow:hidden;width:100%;background-color:#ccc;background-image:linear-gradient(to right,#7892a1 50%,#ccc 50%);background-position:right bottom;background-size:300% 100%}.s-step-disabled{opacity:.5;filter:Alpha(Opacity=50)}.s-step-disabled,.s-step-disabled *{cursor:text!important}.s-step-active.s-step-disabled{opacity:1}.s-step-index{background-color:#fff;border:3px solid #ccc;border-radius:50%;color:#999;display:inline-block;font-weight:700;position:relative;transition:background-color .2s ease-out;height:40px;width:40px;-ms-flex:none;flex:none}.s-step-index .s-step-index-content{line-height:18px;font-size:18px;padding-top:8.5px;text-align:center;position:relative;cursor:pointer}.s-step-index:hover{background-color:#f7f7f7}.s-step-warning .s-step-index .s-step-index-content{padding-top:7px}.s-step-visited .s-step-index{border-color:#7892a1;animation:.1s ease-out alternate scale-up-center;background-color:#7892a1}.s-step-visited .s-step-index-content>span{color:#fff}.s-step-active.s-step-progress-bar,.s-step-visited.s-step-progress-bar{background-position:left bottom}.s-step-active .s-step-index{border-color:#7892a1;color:#7892a1;cursor:default}.s-step-active .s-step-label{color:#333;font-weight:700}@media (max-width:767px){.s-step-label{display:none}}"]
16084
+ })
16085
+ ], StepsComponent);
16086
+
16087
+ let StepsModule = class StepsModule {
16088
+ };
16089
+ StepsModule = __decorate([
16090
+ NgModule({
16091
+ imports: [CommonModule, TooltipModule$1],
16092
+ declarations: [StepsComponent],
16093
+ exports: [StepsComponent],
16094
+ })
16095
+ ], StepsModule);
15975
16096
 
15976
16097
  var TileComponent_1;
15977
16098
  let TileComponent = TileComponent_1 = class TileComponent {
@@ -16883,5 +17004,5 @@ const fallback = {
16883
17004
  * Generated bundle index. Do not edit.
16884
17005
  */
16885
17006
 
16886
- export { AccordionComponent, AccordionModule, AccordionPanelComponent, AlertComponent, AlertModule, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, CardComponent, CardModule, CardTemplateTypes, 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, FileUploadPermissions, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, IAInsightComponent, IAInsightModule, IAInsightTemplateTypes, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, KanbanComponent, KanbanModule, KanbanTemplateTypes, 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, SVGFactoryDirective, SVGFactoryModule, Section, SelectButtonComponent, SelectButtonModule, 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, convertToMomentDateFormat, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, TextFieldComponent as ɵba, NumberFieldModule as ɵbb, LocalizedNumberInputModule as ɵbc, NumberInputModule as ɵbd, NumberFieldComponent as ɵbe, CurrencyFieldModule as ɵbf, CurrencyFieldComponent as ɵbg, NumberFieldModule$1 as ɵbh, BignumberInputModule as ɵbi, BignumberFieldComponent as ɵbj, ProfilePictureModule as ɵbk, ThumbnailService as ɵbl, StructureModule as ɵbm, HeaderComponent as ɵbn, FooterComponent as ɵbo, ProfilePictureFieldComponent as ɵbp, AutocompleteFieldComponent as ɵbq, BooleanFieldComponent as ɵbr, BooleanSwitchFieldComponent as ɵbs, CalendarFieldComponent as ɵbt, ChipsFieldComponent as ɵbu, CountryPhonePickerFieldComponent as ɵbv, DynamicFieldComponent as ɵbw, DynamicFormDirective as ɵbx, FieldsetComponent as ɵby, FileUploadComponent$1 as ɵbz, TemplateDirective as ɵc, LookupFieldComponent as ɵca, RadioButtonComponent as ɵcb, RowComponent as ɵcc, SectionComponent as ɵcd, SelectFieldComponent as ɵce, SliderFieldComponent as ɵcf, TextAreaFieldComponent as ɵcg, TextAreaIAFieldComponent as ɵch, IAssistService as ɵci, DecimalField as ɵck, SideTableComponent as ɵcl, InfiniteScrollModule as ɵcm, InfiniteScrollDirective as ɵcn, IAInsightSidebarComponent as ɵco, IAInsightCardComponent as ɵcp, IAInsightCardLoaderComponent as ɵcq, KanbanEventService as ɵcr, KanbanItemComponent as ɵcs, KanbanColumnComponent as ɵct, KanbanItemDraggingComponent as ɵcu, NumberLocaleOptions as ɵcv, BorderButtonModule as ɵcw, BorderButtonComponent as ɵcx, ProgressBarDeterminateComponent as ɵcy, ProgressBarIndeterminateComponent as ɵcz, TemplateModule as ɵd, SelectButtonItemComponent as ɵda, SlidePanelService as ɵdb, TieredMenuEventService as ɵdc, TieredMenuService as ɵdd, TieredMenuGlobalService as ɵde, TieredMenuComponent as ɵdf, TieredMenuNestedComponent as ɵdg, TieredMenuItemComponent as ɵdh, TieredMenuDividerComponent as ɵdi, TimelineItemModule as ɵdj, TimelineIconItemComponent as ɵdk, HorizontalTimelineModule as ɵdl, HorizontalTimelineComponent as ɵdm, VerticalTimelineModule as ɵdn, VerticalTimelineComponent as ɵdo, RangeLineComponent as ɵdp, CollapseOptionComponent as ɵdq, CollapsedItemsComponent as ɵdr, VerticalItemsComponent as ɵds, CustomTranslationsModule as ɵe, CodeEditorComponent as ɵf, CoreFacade as ɵg, CodeMirror6Core as ɵh, CountryPhonePickerService as ɵi, LocalizedCurrencyImpurePipe as ɵj, LocalizedBignumberPipe as ɵk, LocalizedBignumberImpurePipe as ɵl, NumericPipe as ɵm, NumericService as ɵn, EmptyStateGoBackComponent as ɵo, IAssistIconComponent as ɵp, SeniorIconComponent as ɵq, DotsIndicatorComponent as ɵr, LoadingIndicatorComponent as ɵs, FileUploadService as ɵt, InfoSignComponent as ɵu, TableColumnsComponent as ɵv, TablePagingComponent as ɵw, PasswordFieldModule as ɵx, PasswordFieldComponent as ɵy, TextFieldModule as ɵz };
17007
+ export { AccordionComponent, AccordionModule, AccordionPanelComponent, AlertComponent, AlertModule, AngularComponentsModule, AutocompleteField, BadgeColors, BadgeComponent, BadgeModule, BaseFieldComponent, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, CardComponent, CardModule, CardTemplateTypes, 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, FileUploadPermissions, FileValidation, FormField, GanttComponent, GanttModule, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, IAInsightComponent, IAInsightModule, IAInsightTemplateTypes, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, KanbanComponent, KanbanModule, KanbanTemplateTypes, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationButtonComponent, NavigationButtonModule, 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, SVGFactoryDirective, SVGFactoryModule, Section, SelectButtonComponent, SelectButtonModule, 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, convertToMomentDateFormat, countries, fallback, TooltipComponent as ɵa, TooltipDirective as ɵb, TextFieldComponent as ɵba, NumberFieldModule as ɵbb, LocalizedNumberInputModule as ɵbc, NumberInputModule as ɵbd, NumberFieldComponent as ɵbe, CurrencyFieldModule as ɵbf, CurrencyFieldComponent as ɵbg, NumberFieldModule$1 as ɵbh, BignumberInputModule as ɵbi, BignumberFieldComponent as ɵbj, ProfilePictureModule as ɵbk, ThumbnailService as ɵbl, StructureModule as ɵbm, HeaderComponent as ɵbn, FooterComponent as ɵbo, ProfilePictureFieldComponent as ɵbp, AutocompleteFieldComponent as ɵbq, BooleanFieldComponent as ɵbr, BooleanSwitchFieldComponent as ɵbs, CalendarFieldComponent as ɵbt, ChipsFieldComponent as ɵbu, CountryPhonePickerFieldComponent as ɵbv, DynamicFieldComponent as ɵbw, DynamicFormDirective as ɵbx, FieldsetComponent as ɵby, FileUploadComponent$1 as ɵbz, TemplateDirective as ɵc, LookupFieldComponent as ɵca, RadioButtonComponent as ɵcb, RowComponent as ɵcc, SectionComponent as ɵcd, SelectFieldComponent as ɵce, SliderFieldComponent as ɵcf, TextAreaFieldComponent as ɵcg, TextAreaIAFieldComponent as ɵch, IAssistService as ɵci, DecimalField as ɵck, SideTableComponent as ɵcl, InfiniteScrollModule as ɵcm, InfiniteScrollDirective as ɵcn, IAInsightSidebarComponent as ɵco, IAInsightCardComponent as ɵcp, IAInsightCardLoaderComponent as ɵcq, KanbanEventService as ɵcr, KanbanItemComponent as ɵcs, KanbanColumnComponent as ɵct, KanbanItemDraggingComponent as ɵcu, NumberLocaleOptions as ɵcv, TieredMenuEventService as ɵcw, TieredMenuService as ɵcx, TieredMenuGlobalService as ɵcy, TieredMenuComponent as ɵcz, TemplateModule as ɵd, TieredMenuNestedComponent as ɵda, TieredMenuItemComponent as ɵdb, TieredMenuDividerComponent as ɵdc, BorderButtonModule as ɵdd, BorderButtonComponent as ɵde, ProgressBarDeterminateComponent as ɵdf, ProgressBarIndeterminateComponent as ɵdg, SelectButtonItemComponent as ɵdh, SlidePanelService as ɵdi, TimelineItemModule as ɵdj, TimelineIconItemComponent as ɵdk, HorizontalTimelineModule as ɵdl, HorizontalTimelineComponent as ɵdm, VerticalTimelineModule as ɵdn, VerticalTimelineComponent as ɵdo, RangeLineComponent as ɵdp, CollapseOptionComponent as ɵdq, CollapsedItemsComponent as ɵdr, VerticalItemsComponent as ɵds, CustomTranslationsModule as ɵe, CodeEditorComponent as ɵf, CoreFacade as ɵg, CodeMirror6Core as ɵh, CountryPhonePickerService as ɵi, LocalizedCurrencyImpurePipe as ɵj, LocalizedBignumberPipe as ɵk, LocalizedBignumberImpurePipe as ɵl, NumericPipe as ɵm, NumericService as ɵn, EmptyStateGoBackComponent as ɵo, IAssistIconComponent as ɵp, SeniorIconComponent as ɵq, DotsIndicatorComponent as ɵr, LoadingIndicatorComponent as ɵs, FileUploadService as ɵt, InfoSignComponent as ɵu, TableColumnsComponent as ɵv, TablePagingComponent as ɵw, PasswordFieldModule as ɵx, PasswordFieldComponent as ɵy, TextFieldModule as ɵz };
16887
17008
  //# sourceMappingURL=seniorsistemas-angular-components.js.map