@seniorsistemas/angular-components 17.8.9 → 17.8.11

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 (42) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +2108 -1975
  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/dynamic-form/configurations/fields/profile-picture.d.ts +2 -2
  6. package/components/dynamic-form/dynamic-form.d.ts +1 -0
  7. package/components/dynamic-form/dynamic-form.directive.d.ts +3 -2
  8. package/components/index.d.ts +1 -0
  9. package/components/navigation-button/index.d.ts +3 -0
  10. package/components/navigation-button/models/navigation-button-item.d.ts +5 -0
  11. package/components/navigation-button/navigation-button.component.d.ts +27 -0
  12. package/components/navigation-button/navigation-button.module.d.ts +2 -0
  13. package/components/profile-picture-picker/index.d.ts +1 -1
  14. package/esm2015/components/country-phone-picker/country-phone-picker.component.js +1 -1
  15. package/esm2015/components/dynamic-form/configurations/fields/profile-picture.js +1 -1
  16. package/esm2015/components/dynamic-form/dynamic-form.directive.js +5 -2
  17. package/esm2015/components/dynamic-form/dynamic-form.js +23 -4
  18. package/esm2015/components/index.js +2 -1
  19. package/esm2015/components/navigation-button/index.js +3 -0
  20. package/esm2015/components/navigation-button/models/navigation-button-item.js +1 -0
  21. package/esm2015/components/navigation-button/navigation-button.component.js +95 -0
  22. package/esm2015/components/navigation-button/navigation-button.module.js +17 -0
  23. package/esm2015/components/profile-picture-picker/index.js +1 -1
  24. package/esm2015/seniorsistemas-angular-components.js +14 -14
  25. package/esm5/components/country-phone-picker/country-phone-picker.component.js +1 -1
  26. package/esm5/components/dynamic-form/configurations/fields/profile-picture.js +1 -1
  27. package/esm5/components/dynamic-form/dynamic-form.directive.js +5 -2
  28. package/esm5/components/dynamic-form/dynamic-form.js +23 -4
  29. package/esm5/components/index.js +2 -1
  30. package/esm5/components/navigation-button/index.js +3 -0
  31. package/esm5/components/navigation-button/models/navigation-button-item.js +1 -0
  32. package/esm5/components/navigation-button/navigation-button.component.js +100 -0
  33. package/esm5/components/navigation-button/navigation-button.module.js +20 -0
  34. package/esm5/components/profile-picture-picker/index.js +1 -1
  35. package/esm5/seniorsistemas-angular-components.js +14 -14
  36. package/fesm2015/seniorsistemas-angular-components.js +1956 -1833
  37. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  38. package/fesm5/seniorsistemas-angular-components.js +2087 -1956
  39. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  40. package/package.json +1 -1
  41. package/seniorsistemas-angular-components.d.ts +13 -13
  42. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -4506,7 +4506,7 @@
4506
4506
  useExisting: core.forwardRef(function () { return CountryPhonePickerComponent_1; }),
4507
4507
  multi: true,
4508
4508
  }],
4509
- styles: [".country-phone-picker .phone-input{background-color:#fff;border:1px solid #d8d8d8;border-radius:4px;display:-ms-flexbox;display:flex;line-height:normal}.country-phone-picker .phone-input .drop{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex}.country-phone-picker .phone-input .drop .drop-flag{margin-left:12px}.country-phone-picker .phone-input .drop .drop-icon{font-size:12px;margin:0 8px}.country-phone-picker .phone-input .phone-ddi{margin:8px 0}.country-phone-picker .phone-input input{border:none;-ms-flex-positive:1;flex-grow:1;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:150%;margin-left:8px}.country-phone-picker .phone-input input:focus{color:#697882;outline:0}.country-phone-picker .dropdown{background-color:#fff;border-radius:4px;box-shadow:0 4px 5px #00000033;padding:4px 0;position:absolute;margin:2px 0;z-index:999999}.country-phone-picker .dropdown .search{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;padding:8px 12px}.country-phone-picker .dropdown .search .search-field{border:1px solid #d8d8d8;border-radius:4px;-ms-flex-positive:1;flex-grow:1;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;height:36px;line-height:150%;padding:0 32px 0 8px}.country-phone-picker .dropdown .search .search-icon{color:#333;font-size:12px;position:relative;right:24px}.country-phone-picker .dropdown .search .search-clear{color:#333;cursor:pointer;font-size:1rem}.country-phone-picker .dropdown .select-list{list-style:none;max-height:234px;min-width:360px;max-width:100vw;overflow:scroll;padding:0}.country-phone-picker .dropdown .select-list .select-option{cursor:pointer;display:-ms-flexbox;display:flex;padding:12px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.country-phone-picker .dropdown .select-list .select-option .select-option__flag{margin-right:12px}.country-phone-picker .dropdown .select-list .select-option .select-option__name{margin-right:.5rem;max-width:100%;overflow:hidden;text-overflow:ellipsis}.country-phone-picker .dropdown .select-list .select-option .select-option__ddi{color:#697882;font-size:14px;font-family:\"Open Sans\",sans-serif;font-weight:400;line-height:150%}.country-phone-picker .dropdown .select-list .select-option--focused,.country-phone-picker .dropdown .select-list .select-option:hover{background-color:#e5eaea}"]
4509
+ styles: [".country-phone-picker .phone-input{background-color:#fff;border:1px solid #d8d8d8;border-radius:4px;display:-ms-flexbox;display:flex;line-height:normal;overflow:hidden}.country-phone-picker .phone-input .drop{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex}.country-phone-picker .phone-input .drop .drop-flag{margin-left:12px}.country-phone-picker .phone-input .drop .drop-icon{font-size:12px;margin:0 8px}.country-phone-picker .phone-input .phone-ddi{margin:8px 0}.country-phone-picker .phone-input input{border:none;-ms-flex-positive:1;flex-grow:1;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;line-height:150%;margin-left:8px}.country-phone-picker .phone-input input:focus{color:#697882;outline:0}.country-phone-picker .dropdown{background-color:#fff;border-radius:4px;box-shadow:0 4px 5px #00000033;padding:4px 0;position:absolute;margin:2px 0;z-index:999999}.country-phone-picker .dropdown .search{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;padding:8px 12px}.country-phone-picker .dropdown .search .search-field{border:1px solid #d8d8d8;border-radius:4px;-ms-flex-positive:1;flex-grow:1;font-family:\"Open Sans\",sans-serif;font-size:14px;font-weight:400;height:36px;line-height:150%;padding:0 32px 0 8px}.country-phone-picker .dropdown .search .search-icon{color:#333;font-size:12px;position:relative;right:24px}.country-phone-picker .dropdown .search .search-clear{color:#333;cursor:pointer;font-size:1rem}.country-phone-picker .dropdown .select-list{list-style:none;max-height:234px;min-width:360px;max-width:100vw;overflow:scroll;padding:0}.country-phone-picker .dropdown .select-list .select-option{cursor:pointer;display:-ms-flexbox;display:flex;padding:12px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.country-phone-picker .dropdown .select-list .select-option .select-option__flag{margin-right:12px}.country-phone-picker .dropdown .select-list .select-option .select-option__name{margin-right:.5rem;max-width:100%;overflow:hidden;text-overflow:ellipsis}.country-phone-picker .dropdown .select-list .select-option .select-option__ddi{color:#697882;font-size:14px;font-family:\"Open Sans\",sans-serif;font-weight:400;line-height:150%}.country-phone-picker .dropdown .select-list .select-option--focused,.country-phone-picker .dropdown .select-list .select-option:hover{background-color:#e5eaea}"]
4510
4510
  })
4511
4511
  ], CountryPhonePickerComponent);
4512
4512
  return CountryPhonePickerComponent;
@@ -10044,10 +10044,29 @@
10044
10044
  component.instance.field = this.field;
10045
10045
  // Must be this way because some teams use name like "e070emp.codemp"
10046
10046
  component.instance.formControl = this.group["controls"][this.field.name];
10047
+ this._switchEmptyStringToNull(component);
10047
10048
  component.instance.errorMessages = this.errorMessages;
10048
10049
  this.setVariablesByType(component);
10049
10050
  return component;
10050
10051
  };
10052
+ DynamicField.prototype._switchEmptyStringToNull = function (component) {
10053
+ switch (component.instance.field.type) {
10054
+ case exports.FieldType.Password:
10055
+ case exports.FieldType.String:
10056
+ case exports.FieldType.Text:
10057
+ case exports.FieldType.TextIA:
10058
+ var valueChanges$_1 = component.instance.formControl.valueChanges
10059
+ .subscribe(function (value) {
10060
+ if (value === "") {
10061
+ component.instance.formControl.setValue(null, { emitEvent: false });
10062
+ }
10063
+ });
10064
+ component.onDestroy(function () {
10065
+ valueChanges$_1.unsubscribe();
10066
+ });
10067
+ return;
10068
+ }
10069
+ };
10051
10070
  DynamicField.prototype.setVariablesByType = function (component) {
10052
10071
  if (this.field.type == exports.FieldType.Time) {
10053
10072
  component.instance.timeOnly = true;
@@ -10229,6 +10248,9 @@
10229
10248
  this.component.instance.errorMessages = this.errorMessages;
10230
10249
  }
10231
10250
  };
10251
+ DynamicFormDirective.prototype.ngOnDestroy = function () {
10252
+ this.component.destroy();
10253
+ };
10232
10254
  DynamicFormDirective.prototype.isField = function () {
10233
10255
  return exports.FieldType[this.config.type];
10234
10256
  };
@@ -14845,2327 +14867,2436 @@
14845
14867
  return KanbanModule;
14846
14868
  }());
14847
14869
 
14848
- var ObjectCardFieldComponent = /** @class */ (function () {
14849
- function ObjectCardFieldComponent() {
14850
- this.id = "s-object-card-field-" + ObjectCardFieldComponent_1.nextId++;
14851
- this.buttonClick = new core.EventEmitter();
14870
+ var NavigationButtonComponent = /** @class */ (function () {
14871
+ function NavigationButtonComponent() {
14872
+ this.stepChanged = new core.EventEmitter();
14873
+ this.currentIndex = 0;
14874
+ this.isDisabled = false;
14875
+ this.tieredMenuItems = [];
14852
14876
  }
14853
- ObjectCardFieldComponent_1 = ObjectCardFieldComponent;
14854
- var ObjectCardFieldComponent_1;
14855
- ObjectCardFieldComponent.nextId = 0;
14856
- __decorate([
14857
- core.Input()
14858
- ], ObjectCardFieldComponent.prototype, "id", void 0);
14859
- __decorate([
14860
- core.Input()
14861
- ], ObjectCardFieldComponent.prototype, "imageSource", void 0);
14862
- __decorate([
14863
- core.Input()
14864
- ], ObjectCardFieldComponent.prototype, "imageAlt", void 0);
14865
- __decorate([
14866
- core.Input()
14867
- ], ObjectCardFieldComponent.prototype, "iconClass", void 0);
14868
- __decorate([
14869
- core.Input()
14870
- ], ObjectCardFieldComponent.prototype, "label", void 0);
14877
+ NavigationButtonComponent_1 = NavigationButtonComponent;
14878
+ NavigationButtonComponent.prototype.ngOnInit = function () {
14879
+ var _this = this;
14880
+ var index = this.steps.findIndex(function (step) { return step.value === _this._value; });
14881
+ this.currentIndex = index !== -1 ? index : 0;
14882
+ this.stepChanged.emit({
14883
+ previous: undefined,
14884
+ current: this.steps[this.currentIndex],
14885
+ });
14886
+ this._createTieredMenuItems();
14887
+ };
14888
+ NavigationButtonComponent.prototype.writeValue = function (value) {
14889
+ var _this = this;
14890
+ this._value = value;
14891
+ var index = this.steps.findIndex(function (step) { return step.value === _this._value; });
14892
+ this.currentIndex = index !== -1 ? index : 0;
14893
+ };
14894
+ NavigationButtonComponent.prototype.registerOnChange = function (onChange) {
14895
+ this._onChange = onChange;
14896
+ };
14897
+ NavigationButtonComponent.prototype.registerOnTouched = function (onTouched) {
14898
+ this._onTouched = onTouched;
14899
+ };
14900
+ NavigationButtonComponent.prototype.setDisabledState = function (isDisabled) {
14901
+ this.isDisabled = isDisabled;
14902
+ };
14903
+ NavigationButtonComponent.prototype.onNext = function () {
14904
+ if (this.isDisabled)
14905
+ return;
14906
+ var previous = this.steps[this.currentIndex];
14907
+ if (this.currentIndex < this.steps.length - 1) {
14908
+ this.currentIndex++;
14909
+ }
14910
+ var current = this.steps[this.currentIndex];
14911
+ this._onTouched && this._onTouched();
14912
+ this._onChange && this._onChange(current.value);
14913
+ this.stepChanged.emit({ previous: previous, current: current });
14914
+ };
14915
+ NavigationButtonComponent.prototype.onPrevious = function () {
14916
+ if (this.isDisabled)
14917
+ return;
14918
+ var previous = this.steps[this.currentIndex];
14919
+ if (this.currentIndex > 0) {
14920
+ this.currentIndex--;
14921
+ }
14922
+ var current = this.steps[this.currentIndex];
14923
+ this._onTouched && this._onTouched();
14924
+ this._onChange && this._onChange(current.value);
14925
+ this.stepChanged.emit({ previous: previous, current: current });
14926
+ };
14927
+ NavigationButtonComponent.prototype._createTieredMenuItems = function () {
14928
+ var _this = this;
14929
+ this.steps.forEach(function (step) {
14930
+ _this.tieredMenuItems.push({
14931
+ label: step.label,
14932
+ command: function () { return _this.currentIndex = _this.steps.findIndex(function (s) { return s === step; }); },
14933
+ });
14934
+ });
14935
+ };
14936
+ var NavigationButtonComponent_1;
14871
14937
  __decorate([
14872
14938
  core.Input()
14873
- ], ObjectCardFieldComponent.prototype, "description", void 0);
14939
+ ], NavigationButtonComponent.prototype, "steps", void 0);
14874
14940
  __decorate([
14875
14941
  core.Input()
14876
- ], ObjectCardFieldComponent.prototype, "buttonLabel", void 0);
14942
+ ], NavigationButtonComponent.prototype, "defaultValue", void 0);
14877
14943
  __decorate([
14878
14944
  core.Input()
14879
- ], ObjectCardFieldComponent.prototype, "buttonModel", void 0);
14945
+ ], NavigationButtonComponent.prototype, "tooltip", void 0);
14880
14946
  __decorate([
14881
14947
  core.Output()
14882
- ], ObjectCardFieldComponent.prototype, "buttonClick", void 0);
14883
- __decorate([
14884
- core.ContentChild(ThumbnailComponent, { static: true })
14885
- ], ObjectCardFieldComponent.prototype, "thumbnailComponent", void 0);
14886
- __decorate([
14887
- core.ViewChild(core.TemplateRef, { static: true })
14888
- ], ObjectCardFieldComponent.prototype, "content", void 0);
14889
- ObjectCardFieldComponent = ObjectCardFieldComponent_1 = __decorate([
14948
+ ], NavigationButtonComponent.prototype, "stepChanged", void 0);
14949
+ NavigationButtonComponent = NavigationButtonComponent_1 = __decorate([
14890
14950
  core.Component({
14891
- selector: "s-object-card-field",
14892
- 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",
14893
- 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}"]
14951
+ selector: "s-navigation-button",
14952
+ 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",
14953
+ providers: [
14954
+ {
14955
+ provide: forms.NG_VALUE_ACCESSOR,
14956
+ useExisting: core.forwardRef(function () { return NavigationButtonComponent_1; }),
14957
+ multi: true,
14958
+ },
14959
+ ],
14960
+ 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}"]
14894
14961
  })
14895
- ], ObjectCardFieldComponent);
14896
- return ObjectCardFieldComponent;
14962
+ ], NavigationButtonComponent);
14963
+ return NavigationButtonComponent;
14897
14964
  }());
14898
14965
 
14899
- var ObjectCardMainComponent = /** @class */ (function () {
14900
- function ObjectCardMainComponent() {
14901
- this.id = "s-object-card-main-" + ObjectCardMainComponent_1.nextId++;
14902
- this.iconClass = "fa fa-picture-o";
14903
- this.hasThumbnail = true;
14904
- this.hasDescription = true;
14905
- this.isBrand = false;
14906
- this.buttonClick = new core.EventEmitter();
14907
- this._thumbnailSize = exports.ThumbnailSize.Medium;
14966
+ var TieredMenuDividerComponent = /** @class */ (function () {
14967
+ function TieredMenuDividerComponent() {
14908
14968
  }
14909
- ObjectCardMainComponent_1 = ObjectCardMainComponent;
14910
- Object.defineProperty(ObjectCardMainComponent.prototype, "thumbnailSize", {
14911
- get: function () {
14912
- return this._thumbnailSize;
14913
- },
14914
- set: function (value) {
14915
- this._thumbnailSize = value;
14916
- if (this.thumbnailComponent)
14917
- this.thumbnailComponent.size = value;
14918
- },
14919
- enumerable: true,
14920
- configurable: true
14921
- });
14922
- ObjectCardMainComponent.prototype.onResize = function () {
14923
- this.update();
14969
+ TieredMenuDividerComponent = __decorate([
14970
+ core.Component({
14971
+ selector: "s-tiered-menu-divider",
14972
+ template: "<div class=\"divider\"></div>",
14973
+ styles: [".divider{margin:2px 0;height:1px;background-color:#ccc}"]
14974
+ })
14975
+ ], TieredMenuDividerComponent);
14976
+ return TieredMenuDividerComponent;
14977
+ }());
14978
+
14979
+ var TieredMenuEventService = /** @class */ (function () {
14980
+ function TieredMenuEventService() {
14981
+ this.incrementCurrentItemEvent = new core.EventEmitter();
14982
+ this.decrementCurrentItemEvent = new core.EventEmitter();
14983
+ this.closeAllMenusEvent = new core.EventEmitter();
14984
+ this.selectItemEvent = new core.EventEmitter();
14985
+ this.openItemMenuEvent = new core.EventEmitter();
14986
+ this.closeItemMenuEvent = new core.EventEmitter();
14987
+ this.createMenuEvent = new core.EventEmitter();
14988
+ }
14989
+ TieredMenuEventService = __decorate([
14990
+ core.Injectable()
14991
+ ], TieredMenuEventService);
14992
+ return TieredMenuEventService;
14993
+ }());
14994
+
14995
+ var TieredMenuItemComponent = /** @class */ (function () {
14996
+ function TieredMenuItemComponent(_tieredMenuEventService) {
14997
+ this._tieredMenuEventService = _tieredMenuEventService;
14998
+ this.focused = false;
14999
+ this.highlight = false;
15000
+ this.triggerEvent = "click";
15001
+ this.closeOnClick = false;
15002
+ }
15003
+ TieredMenuItemComponent.prototype.onClick = function () {
15004
+ if (this.item.disabled)
15005
+ return;
15006
+ if (this.item.submenu) {
15007
+ if (!this.item.isOpen) {
15008
+ this._tieredMenuEventService.openItemMenuEvent.emit(this.item);
15009
+ }
15010
+ else if (this.closeOnClick) {
15011
+ this._tieredMenuEventService.closeItemMenuEvent.emit(this.item);
15012
+ }
15013
+ }
15014
+ else {
15015
+ this._tieredMenuEventService.selectItemEvent.emit(this.item);
15016
+ }
14924
15017
  };
14925
- ObjectCardMainComponent.prototype.ngAfterContentInit = function () {
14926
- this.update();
15018
+ TieredMenuItemComponent.prototype.onMouseEnter = function () {
15019
+ var _this = this;
15020
+ if (this.item.disabled)
15021
+ return;
15022
+ if (this.triggerEvent === "hover" && !this.item.isOpen) {
15023
+ this._showTimeout = window.setTimeout(function () {
15024
+ _this._tieredMenuEventService.openItemMenuEvent.emit(_this.item);
15025
+ }, 300);
15026
+ }
14927
15027
  };
14928
- ObjectCardMainComponent.prototype.update = function () {
14929
- var windowWidth = window.innerWidth;
14930
- if (windowWidth <= Breakpoints.SM_MAX)
14931
- this.thumbnailSize = exports.ThumbnailSize.Small;
14932
- else
14933
- this.thumbnailSize = exports.ThumbnailSize.Medium;
15028
+ TieredMenuItemComponent.prototype.onMouseLeave = function () {
15029
+ window.clearTimeout(this._showTimeout);
14934
15030
  };
14935
- var ObjectCardMainComponent_1;
14936
- ObjectCardMainComponent.nextId = 0;
14937
- __decorate([
14938
- core.Input()
14939
- ], ObjectCardMainComponent.prototype, "id", void 0);
14940
- __decorate([
14941
- core.Input()
14942
- ], ObjectCardMainComponent.prototype, "imageSource", void 0);
14943
- __decorate([
14944
- core.Input()
14945
- ], ObjectCardMainComponent.prototype, "imageFallback", void 0);
14946
- __decorate([
14947
- core.Input()
14948
- ], ObjectCardMainComponent.prototype, "imageAlt", void 0);
14949
- __decorate([
14950
- core.Input()
14951
- ], ObjectCardMainComponent.prototype, "iconClass", void 0);
14952
- __decorate([
14953
- core.Input()
14954
- ], ObjectCardMainComponent.prototype, "hasThumbnail", void 0);
14955
- __decorate([
14956
- core.Input()
14957
- ], ObjectCardMainComponent.prototype, "hasDescription", void 0);
15031
+ TieredMenuItemComponent.ctorParameters = function () { return [
15032
+ { type: TieredMenuEventService }
15033
+ ]; };
14958
15034
  __decorate([
14959
15035
  core.Input()
14960
- ], ObjectCardMainComponent.prototype, "isBrand", void 0);
15036
+ ], TieredMenuItemComponent.prototype, "item", void 0);
14961
15037
  __decorate([
14962
15038
  core.Input()
14963
- ], ObjectCardMainComponent.prototype, "label", void 0);
15039
+ ], TieredMenuItemComponent.prototype, "focused", void 0);
14964
15040
  __decorate([
14965
15041
  core.Input()
14966
- ], ObjectCardMainComponent.prototype, "description", void 0);
15042
+ ], TieredMenuItemComponent.prototype, "highlight", void 0);
14967
15043
  __decorate([
14968
15044
  core.Input()
14969
- ], ObjectCardMainComponent.prototype, "buttonLabel", void 0);
15045
+ ], TieredMenuItemComponent.prototype, "triggerEvent", void 0);
14970
15046
  __decorate([
14971
15047
  core.Input()
14972
- ], ObjectCardMainComponent.prototype, "buttonModel", void 0);
15048
+ ], TieredMenuItemComponent.prototype, "closeOnClick", void 0);
14973
15049
  __decorate([
14974
- core.Output()
14975
- ], ObjectCardMainComponent.prototype, "buttonClick", void 0);
15050
+ core.HostListener("click"),
15051
+ core.HostListener("touchend")
15052
+ ], TieredMenuItemComponent.prototype, "onClick", null);
14976
15053
  __decorate([
14977
- core.ContentChild(ThumbnailComponent, { static: true })
14978
- ], ObjectCardMainComponent.prototype, "thumbnailComponent", void 0);
15054
+ core.HostListener("mouseenter")
15055
+ ], TieredMenuItemComponent.prototype, "onMouseEnter", null);
14979
15056
  __decorate([
14980
- core.HostListener("window:resize")
14981
- ], ObjectCardMainComponent.prototype, "onResize", null);
14982
- ObjectCardMainComponent = ObjectCardMainComponent_1 = __decorate([
15057
+ core.HostListener("mouseleave")
15058
+ ], TieredMenuItemComponent.prototype, "onMouseLeave", null);
15059
+ TieredMenuItemComponent = __decorate([
14983
15060
  core.Component({
14984
- selector: "s-object-card-main",
14985
- 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",
14986
- 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}}"]
15061
+ selector: "s-tiered-menu-item",
15062
+ 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>",
15063
+ 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}"]
14987
15064
  })
14988
- ], ObjectCardMainComponent);
14989
- return ObjectCardMainComponent;
15065
+ ], TieredMenuItemComponent);
15066
+ return TieredMenuItemComponent;
14990
15067
  }());
14991
15068
 
14992
-
14993
- (function (EnumSeverity) {
14994
- EnumSeverity["Default"] = "Default";
14995
- EnumSeverity["Info"] = "Info";
14996
- EnumSeverity["Warn"] = "Warn";
14997
- EnumSeverity["Error"] = "Error";
14998
- EnumSeverity["Success"] = "Success";
14999
- })(exports.EnumSeverity || (exports.EnumSeverity = {}));
15000
-
15001
- var elementResizeDetectorMaker = elementResizeDetectorMaker_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
15002
- var ObjectCardComponent = /** @class */ (function () {
15003
- function ObjectCardComponent(cdr, elementRef) {
15004
- this.cdr = cdr;
15005
- this.elementRef = elementRef;
15006
- this.id = "s-object-card-" + ObjectCardComponent_1.nextId++;
15007
- this.expanded = false;
15008
- this.expandTooltip = "Abrir painel";
15009
- this.collapseTooltip = "Fechar painel";
15010
- this.fieldsMinWidth = 200;
15011
- this.expandedChange = new core.EventEmitter();
15012
- this.maxVisibleFields = 0;
15013
- this.severity = exports.EnumSeverity.Default;
15014
- this.EnumSeverity = exports.EnumSeverity;
15069
+ var TieredMenuService = /** @class */ (function () {
15070
+ function TieredMenuService() {
15071
+ this.currentItems = [];
15072
+ this.items = [];
15015
15073
  }
15016
- ObjectCardComponent_1 = ObjectCardComponent;
15017
- ObjectCardComponent.prototype.ngAfterViewInit = function () {
15074
+ TieredMenuService.prototype.normalizeData = function (items, parent) {
15018
15075
  var _this = this;
15019
- this.update();
15020
- this.cdr.detectChanges();
15021
- this.fields.changes.subscribe(function () {
15022
- _this.update();
15076
+ return items.map(function (i) {
15077
+ var item = __assign({ visible: true }, i);
15078
+ if (item.submenu) {
15079
+ item.submenu = _this.normalizeData(item.submenu, item);
15080
+ }
15081
+ item.id = _this._generateId();
15082
+ item.parent = parent;
15083
+ item.isOpen = false;
15084
+ return item;
15023
15085
  });
15024
- var erd = elementResizeDetectorMaker({
15025
- strategy: "scroll",
15086
+ };
15087
+ TieredMenuService.prototype.markAllItemsAsClosed = function (items) {
15088
+ var _this = this;
15089
+ return items.map(function (i) {
15090
+ var item = __assign({}, i);
15091
+ if (item.submenu) {
15092
+ item.submenu = _this.markAllItemsAsClosed(item.submenu);
15093
+ }
15094
+ item.isOpen = false;
15095
+ return item;
15026
15096
  });
15027
- erd.listenTo(this.elementRef.nativeElement, function () { return _this.update(); });
15028
15097
  };
15029
- ObjectCardComponent.prototype.update = function () {
15030
- var e_1, _a;
15031
- var windowWidth = window.innerWidth;
15032
- var containerWidth = this.elementRef.nativeElement.offsetWidth;
15033
- var mainFieldWidth = containerWidth * 0.3 > 260 ? containerWidth * 0.3 : 260;
15034
- var fieldsMinWidth = this.fieldsMinWidth;
15035
- var expandIconWidth = 50;
15036
- var fieldElementList = this.elementRef.nativeElement.getElementsByClassName("s-object-card-field");
15037
- try {
15038
- for (var fieldElementList_1 = __values(fieldElementList), fieldElementList_1_1 = fieldElementList_1.next(); !fieldElementList_1_1.done; fieldElementList_1_1 = fieldElementList_1.next()) {
15039
- var element = fieldElementList_1_1.value;
15040
- element.style.minWidth = this.fieldsMinWidth + "px";
15098
+ TieredMenuService.prototype.searchTheHierarchy = function (itemA, itemB) {
15099
+ var item = itemB;
15100
+ while (item) {
15101
+ if (item === itemA) {
15102
+ return true;
15041
15103
  }
15104
+ item = item.parent;
15042
15105
  }
15043
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
15044
- finally {
15045
- try {
15046
- if (fieldElementList_1_1 && !fieldElementList_1_1.done && (_a = fieldElementList_1.return)) _a.call(fieldElementList_1);
15047
- }
15048
- finally { if (e_1) throw e_1.error; }
15106
+ return false;
15107
+ };
15108
+ TieredMenuService.prototype.cloneItems = function (items) {
15109
+ return JSON.parse(JSON.stringify(items));
15110
+ };
15111
+ TieredMenuService.prototype._generateId = function () {
15112
+ return "id-" + Math.random().toString(36).substring(2, 9) + "-" + Math.random().toString(36).substring(2, 9) + "-" + Math.random().toString(36).substring(2, 9);
15113
+ };
15114
+ TieredMenuService = __decorate([
15115
+ core.Injectable()
15116
+ ], TieredMenuService);
15117
+ return TieredMenuService;
15118
+ }());
15119
+
15120
+ var TieredMenuNestedComponent = /** @class */ (function () {
15121
+ function TieredMenuNestedComponent(tieredMenuService, _tieredMenuEventService) {
15122
+ this.tieredMenuService = tieredMenuService;
15123
+ this._tieredMenuEventService = _tieredMenuEventService;
15124
+ this.top = 0;
15125
+ this.left = 0;
15126
+ this._unsubscribe$ = new rxjs.Subject();
15127
+ }
15128
+ TieredMenuNestedComponent.prototype.onResize = function () {
15129
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
15130
+ };
15131
+ TieredMenuNestedComponent.prototype.onDocumentClick = function (event) {
15132
+ // Closing menu when clicked outside.
15133
+ var target = event.target;
15134
+ var clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
15135
+ if (!clickedInside) {
15136
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
15049
15137
  }
15050
- var maxFieldQtd;
15051
- if (windowWidth <= Breakpoints.SM_MAX)
15052
- maxFieldQtd = 0;
15053
- else
15054
- maxFieldQtd = Math.floor((containerWidth - mainFieldWidth) / fieldsMinWidth);
15055
- if (maxFieldQtd && maxFieldQtd < this.fields.length) {
15056
- maxFieldQtd = Math.floor((containerWidth - mainFieldWidth - expandIconWidth) / fieldsMinWidth);
15138
+ };
15139
+ TieredMenuNestedComponent.prototype.onKeydownHandler = function (event) {
15140
+ switch (event.key) {
15141
+ case "Escape":
15142
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
15143
+ break;
15144
+ case " ":
15145
+ case "Enter":
15146
+ this._tieredMenuEventService.selectItemEvent.emit(this.tieredMenuService.currentItem);
15147
+ break;
15148
+ case "ArrowLeft":
15149
+ // When nested I need a reference to the current item's parent item, otherwise just the current item.
15150
+ this._tieredMenuEventService.closeItemMenuEvent.emit(this.tieredMenuService.currentItem.parent);
15151
+ break;
15152
+ case "ArrowRight":
15153
+ this._tieredMenuEventService.openItemMenuEvent.emit(this.tieredMenuService.currentItem);
15154
+ break;
15155
+ case "ArrowUp":
15156
+ this._tieredMenuEventService.decrementCurrentItemEvent.emit();
15157
+ break;
15158
+ case "ArrowDown":
15159
+ this._tieredMenuEventService.incrementCurrentItemEvent.emit();
15160
+ break;
15057
15161
  }
15058
- this.maxVisibleFields = maxFieldQtd;
15059
- if (maxFieldQtd >= this.fields.length && this.expanded)
15060
- this.collapse();
15061
15162
  };
15062
- ObjectCardComponent.prototype.toggle = function () {
15063
- this.expanded ? this.collapse() : this.expand();
15163
+ TieredMenuNestedComponent.prototype.ngOnInit = function () {
15164
+ this.tieredMenuService.currentItems = this.items;
15165
+ this._subscribeEvents();
15064
15166
  };
15065
- ObjectCardComponent.prototype.expand = function () {
15066
- this.expanded = true;
15067
- this.expandedChange.emit(this.expanded);
15167
+ TieredMenuNestedComponent.prototype.ngOnDestroy = function () {
15168
+ this._unsubscribe$.next();
15169
+ this._unsubscribe$.complete();
15068
15170
  };
15069
- ObjectCardComponent.prototype.collapse = function () {
15070
- this.expanded = false;
15071
- this.expandedChange.emit(this.expanded);
15171
+ TieredMenuNestedComponent.prototype._incrementCurItem = function () {
15172
+ if (!this.tieredMenuService.currentItem) {
15173
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15174
+ return;
15175
+ }
15176
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
15177
+ if (curIndex < this.tieredMenuService.currentItems.length) {
15178
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
15179
+ }
15180
+ else {
15181
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15182
+ }
15183
+ if (this.tieredMenuService.currentItem.divider) {
15184
+ this._incrementCurItem();
15185
+ }
15072
15186
  };
15073
- ObjectCardComponent.prototype.getExpandedFieldWidth = function () {
15074
- var containerWidth = this.elementRef.nativeElement.offsetWidth;
15075
- var fieldsPerRow;
15076
- if (containerWidth <= Breakpoints.SM_MAX)
15077
- fieldsPerRow = 1;
15078
- else if (containerWidth <= Breakpoints.MD_MAX)
15079
- fieldsPerRow = 2;
15080
- else if (containerWidth <= Breakpoints.LG_MAX)
15081
- fieldsPerRow = 4;
15082
- else
15083
- fieldsPerRow = 6;
15084
- return 12 / fieldsPerRow;
15187
+ TieredMenuNestedComponent.prototype._decrementCurItem = function () {
15188
+ if (!this.tieredMenuService.currentItem) {
15189
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15190
+ return;
15191
+ }
15192
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
15193
+ if (curIndex >= 0) {
15194
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
15195
+ }
15196
+ else {
15197
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
15198
+ }
15199
+ if (this.tieredMenuService.currentItem.divider) {
15200
+ this._decrementCurItem();
15201
+ }
15085
15202
  };
15086
- var ObjectCardComponent_1;
15087
- ObjectCardComponent.nextId = 0;
15088
- ObjectCardComponent.ctorParameters = function () { return [
15089
- { type: core.ChangeDetectorRef },
15090
- { type: core.ElementRef }
15203
+ TieredMenuNestedComponent.prototype._closeItem = function (item) {
15204
+ var _a;
15205
+ var itemAux = this._lastOpenItem;
15206
+ while (itemAux && itemAux != item) {
15207
+ itemAux.isOpen = false;
15208
+ itemAux = itemAux.parent;
15209
+ }
15210
+ item.isOpen = false;
15211
+ this.tieredMenuService.currentItem = itemAux !== null && itemAux !== void 0 ? itemAux : this.tieredMenuService.items[0];
15212
+ this.tieredMenuService.currentItems = ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.submenu) || this.tieredMenuService.items;
15213
+ };
15214
+ TieredMenuNestedComponent.prototype._openItem = function (item) {
15215
+ if (item === null || item === void 0 ? void 0 : item.submenu) {
15216
+ item.isOpen = true;
15217
+ this.tieredMenuService.currentItems = item.submenu;
15218
+ // Only has focus if there has already been interaction.
15219
+ if (this.tieredMenuService.currentItem) {
15220
+ this.tieredMenuService.currentItem = item.submenu[0];
15221
+ }
15222
+ this._lastOpenItem = item;
15223
+ }
15224
+ };
15225
+ TieredMenuNestedComponent.prototype._subscribeEvents = function () {
15226
+ var _this = this;
15227
+ this._tieredMenuEventService.incrementCurrentItemEvent
15228
+ .pipe(operators.takeUntil(this._unsubscribe$))
15229
+ .subscribe(function () {
15230
+ _this._incrementCurItem();
15231
+ });
15232
+ this._tieredMenuEventService.decrementCurrentItemEvent
15233
+ .pipe(operators.takeUntil(this._unsubscribe$))
15234
+ .subscribe(function () {
15235
+ _this._decrementCurItem();
15236
+ });
15237
+ this._tieredMenuEventService.selectItemEvent
15238
+ .pipe(operators.takeUntil(this._unsubscribe$))
15239
+ .subscribe(function (item) {
15240
+ if (item.command) {
15241
+ item.command();
15242
+ // Close all menus after the item was selected.
15243
+ _this._tieredMenuEventService.closeAllMenusEvent.emit();
15244
+ }
15245
+ });
15246
+ this._tieredMenuEventService.openItemMenuEvent
15247
+ .pipe(operators.takeUntil(this._unsubscribe$))
15248
+ .subscribe(function (item) {
15249
+ var _a, _b;
15250
+ if (!_this.tieredMenuService.currentItems.includes(item)) {
15251
+ var itemAux = _this._lastOpenItem;
15252
+ while ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.parent) {
15253
+ itemAux = itemAux.parent;
15254
+ }
15255
+ _this._tieredMenuEventService.closeItemMenuEvent.emit((_b = itemAux.parent) !== null && _b !== void 0 ? _b : itemAux);
15256
+ }
15257
+ _this._lastOpenItem = item;
15258
+ _this._openItem(item);
15259
+ });
15260
+ this._tieredMenuEventService.closeItemMenuEvent
15261
+ .pipe(operators.takeUntil(this._unsubscribe$))
15262
+ .subscribe(function (item) {
15263
+ if (item) {
15264
+ _this._closeItem(item);
15265
+ }
15266
+ });
15267
+ };
15268
+ TieredMenuNestedComponent.ctorParameters = function () { return [
15269
+ { type: TieredMenuService },
15270
+ { type: TieredMenuEventService }
15091
15271
  ]; };
15092
15272
  __decorate([
15093
- core.Input()
15094
- ], ObjectCardComponent.prototype, "id", void 0);
15273
+ core.HostListener("window:resize")
15274
+ ], TieredMenuNestedComponent.prototype, "onResize", null);
15095
15275
  __decorate([
15096
- core.Input()
15097
- ], ObjectCardComponent.prototype, "expanded", void 0);
15276
+ core.HostListener("document:click", ["$event"])
15277
+ ], TieredMenuNestedComponent.prototype, "onDocumentClick", null);
15098
15278
  __decorate([
15099
- core.Input()
15100
- ], ObjectCardComponent.prototype, "expandTooltip", void 0);
15101
- __decorate([
15102
- core.Input()
15103
- ], ObjectCardComponent.prototype, "collapseTooltip", void 0);
15104
- __decorate([
15105
- core.Input()
15106
- ], ObjectCardComponent.prototype, "fieldsMinWidth", void 0);
15107
- __decorate([
15108
- core.Output()
15109
- ], ObjectCardComponent.prototype, "expandedChange", void 0);
15110
- __decorate([
15111
- core.ContentChild(ObjectCardMainComponent, { static: true })
15112
- ], ObjectCardComponent.prototype, "main", void 0);
15113
- __decorate([
15114
- core.ContentChildren(ObjectCardFieldComponent, { descendants: true })
15115
- ], ObjectCardComponent.prototype, "fields", void 0);
15116
- __decorate([
15117
- core.Input()
15118
- ], ObjectCardComponent.prototype, "severity", void 0);
15119
- __decorate([
15120
- core.Input()
15121
- ], ObjectCardComponent.prototype, "borderButtonOptions", void 0);
15122
- ObjectCardComponent = ObjectCardComponent_1 = __decorate([
15123
- core.Component({
15124
- selector: "s-object-card",
15125
- 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",
15126
- animations: [
15127
- animations.trigger("expandableContent", [
15128
- animations.state("*", animations.style({
15129
- height: "0",
15130
- })),
15131
- animations.state("false", animations.style({
15132
- height: "0",
15133
- })),
15134
- animations.state("true", animations.style({
15135
- height: "*",
15136
- })),
15137
- animations.transition("* => true", animations.animate("200ms ease-out")),
15138
- animations.transition("false <=> true", animations.animate("200ms ease-out")),
15139
- ]),
15140
- animations.trigger("BorderButtonAnimation", [
15141
- animations.transition(":enter", [
15142
- animations.style({ transform: "scaleY(0)", opacity: 0 }),
15143
- animations.animate("300ms ease", animations.style({ transform: "scaleY(1)", opacity: 1 })),
15144
- ]),
15145
- animations.transition(":leave", [
15146
- animations.style({ transform: "scaleY(1)", opacity: 1 }),
15147
- animations.animate("300ms ease", animations.style({ transform: "scaleY(0)", opacity: 0 })),
15148
- ]),
15149
- ]),
15150
- ],
15151
- 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)}}"]
15152
- })
15153
- ], ObjectCardComponent);
15154
- return ObjectCardComponent;
15155
- }());
15156
-
15157
- var BorderButtonComponent = /** @class */ (function () {
15158
- function BorderButtonComponent() {
15159
- this.severity = exports.EnumSeverity.Default;
15160
- this.EnumSeverity = exports.EnumSeverity;
15161
- this.TooltipPosition = exports.TooltipPosition;
15162
- }
15163
- __decorate([
15164
- core.Input()
15165
- ], BorderButtonComponent.prototype, "severity", void 0);
15166
- __decorate([
15167
- core.Input()
15168
- ], BorderButtonComponent.prototype, "options", void 0);
15169
- BorderButtonComponent = __decorate([
15170
- core.Component({
15171
- selector: "s-border-button",
15172
- 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>",
15173
- 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}"]
15174
- })
15175
- ], BorderButtonComponent);
15176
- return BorderButtonComponent;
15177
- }());
15178
-
15179
- var BorderButtonModule = /** @class */ (function () {
15180
- function BorderButtonModule() {
15181
- }
15182
- BorderButtonModule = __decorate([
15183
- core.NgModule({
15184
- imports: [common.CommonModule, TooltipModule],
15185
- declarations: [BorderButtonComponent],
15186
- exports: [BorderButtonComponent]
15187
- })
15188
- ], BorderButtonModule);
15189
- return BorderButtonModule;
15190
- }());
15191
-
15192
- var ObjectCardModule = /** @class */ (function () {
15193
- function ObjectCardModule() {
15194
- }
15195
- ObjectCardModule = __decorate([
15196
- core.NgModule({
15197
- imports: [common.CommonModule, tooltip.TooltipModule, ThumbnailModule, ButtonModule, BorderButtonModule],
15198
- declarations: [ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
15199
- exports: [ThumbnailModule, ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
15200
- })
15201
- ], ObjectCardModule);
15202
- return ObjectCardModule;
15203
- }());
15204
-
15205
- var ProductHeaderComponent = /** @class */ (function () {
15206
- function ProductHeaderComponent() {
15207
- this.id = "s-product-header-" + ProductHeaderComponent_1.nextId++;
15208
- this.baseZIndex = 0;
15209
- this.isHeaderFrame = true;
15210
- }
15211
- ProductHeaderComponent_1 = ProductHeaderComponent;
15212
- ProductHeaderComponent.prototype.ngAfterViewInit = function () {
15213
- this.container.nativeElement.style.zIndex = String(this.baseZIndex + ++dom.DomHandler.zindex);
15214
- if (this.isHeaderFrame) {
15215
- this.container.nativeElement.style.borderBottom = "1px solid $default-secondary-color";
15216
- }
15217
- else {
15218
- this.container.nativeElement.style.borderTop = "1px solid $default-secondary-color";
15219
- }
15220
- };
15221
- var ProductHeaderComponent_1;
15222
- ProductHeaderComponent.nextId = 0;
15223
- __decorate([
15224
- core.Input()
15225
- ], ProductHeaderComponent.prototype, "id", void 0);
15226
- __decorate([
15227
- core.Input()
15228
- ], ProductHeaderComponent.prototype, "header", void 0);
15229
- __decorate([
15230
- core.Input()
15231
- ], ProductHeaderComponent.prototype, "baseZIndex", void 0);
15232
- __decorate([
15233
- core.Input()
15234
- ], ProductHeaderComponent.prototype, "isHeaderFrame", void 0);
15235
- __decorate([
15236
- core.ViewChild("headerContainer", { static: false })
15237
- ], ProductHeaderComponent.prototype, "container", void 0);
15238
- ProductHeaderComponent = ProductHeaderComponent_1 = __decorate([
15239
- core.Component({
15240
- selector: "s-product-header",
15241
- 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",
15242
- 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}"]
15243
- })
15244
- ], ProductHeaderComponent);
15245
- return ProductHeaderComponent;
15246
- }());
15247
-
15248
- var ProductHeaderModule = /** @class */ (function () {
15249
- function ProductHeaderModule() {
15250
- }
15251
- ProductHeaderModule = __decorate([
15252
- core.NgModule({
15253
- imports: [common.CommonModule, tooltip.TooltipModule, ThumbnailModule],
15254
- declarations: [ProductHeaderComponent],
15255
- exports: [ProductHeaderComponent, ThumbnailModule],
15256
- })
15257
- ], ProductHeaderModule);
15258
- return ProductHeaderModule;
15259
- }());
15260
-
15261
-
15262
- (function (ProgressBarColors) {
15263
- ProgressBarColors["Blue"] = "blue";
15264
- ProgressBarColors["Green"] = "green";
15265
- ProgressBarColors["Red"] = "red";
15266
- ProgressBarColors["Yellow"] = "yellow";
15267
- })(exports.ProgressBarColors || (exports.ProgressBarColors = {}));
15268
-
15269
- var ProgressBarMode;
15270
- (function (ProgressBarMode) {
15271
- ProgressBarMode["Determinate"] = "determinate";
15272
- ProgressBarMode["Indeterminate"] = "indeterminate";
15273
- })(ProgressBarMode || (ProgressBarMode = {}));
15274
-
15275
- var ProgressBarComponent = /** @class */ (function () {
15276
- function ProgressBarComponent() {
15277
- this.numberFormatOptions = {
15278
- style: "decimal",
15279
- minimumFractionDigits: 0,
15280
- maximumFractionDigits: 2,
15281
- };
15282
- this.showValue = true;
15283
- this.mode = ProgressBarMode.Determinate;
15284
- }
15285
- ProgressBarComponent.prototype.ngOnInit = function () {
15286
- this.validateInputs();
15287
- };
15288
- ProgressBarComponent.prototype.validateInputs = function () {
15289
- if (this.value < 0 || this.value > 100) {
15290
- throw new Error("Invalid value for value");
15291
- }
15292
- if (this.targetValue < 0 || this.targetValue > 100) {
15293
- throw new Error("Invalid value for targetValue");
15294
- }
15295
- if (this.mode === ProgressBarMode.Indeterminate && (this.value || this.targetValue || this.targetLabel)) {
15296
- throw new Error("When the mode is indeterminate, the value, targetValue and targetLabel parameters are not expected.");
15297
- }
15298
- };
15299
- __decorate([
15300
- core.Input()
15301
- ], ProgressBarComponent.prototype, "value", void 0);
15302
- __decorate([
15303
- core.Input()
15304
- ], ProgressBarComponent.prototype, "numberFormatOptions", void 0);
15305
- __decorate([
15306
- core.Input()
15307
- ], ProgressBarComponent.prototype, "targetValue", void 0);
15308
- __decorate([
15309
- core.Input()
15310
- ], ProgressBarComponent.prototype, "label", void 0);
15311
- __decorate([
15312
- core.Input()
15313
- ], ProgressBarComponent.prototype, "targetLabel", void 0);
15314
- __decorate([
15315
- core.Input()
15316
- ], ProgressBarComponent.prototype, "activeColor", void 0);
15317
- __decorate([
15318
- core.Input()
15319
- ], ProgressBarComponent.prototype, "showValue", void 0);
15320
- __decorate([
15321
- core.Input()
15322
- ], ProgressBarComponent.prototype, "mode", void 0);
15323
- ProgressBarComponent = __decorate([
15324
- core.Component({
15325
- selector: "s-progressbar",
15326
- 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>",
15327
- 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}"]
15328
- })
15329
- ], ProgressBarComponent);
15330
- return ProgressBarComponent;
15331
- }());
15332
-
15333
- var ProgressBarDeterminateComponent = /** @class */ (function () {
15334
- function ProgressBarDeterminateComponent(localeService) {
15335
- this.localeService = localeService;
15336
- this.showValue = true;
15337
- }
15338
- ProgressBarDeterminateComponent.prototype.ngOnInit = function () {
15339
- this.validateValues();
15340
- this.onGetLocale();
15341
- };
15342
- ProgressBarDeterminateComponent.prototype.onGetLocale = function () {
15343
- var _this = this;
15344
- this.localeService.getLocale().subscribe({
15345
- next: function (locale) {
15346
- _this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", _this.numberFormatOptions);
15347
- },
15348
- error: function () {
15349
- _this.numberFormat = new Intl.NumberFormat("pt-BR", _this.numberFormatOptions);
15350
- },
15351
- });
15352
- };
15353
- ProgressBarDeterminateComponent.prototype.validateValues = function () {
15354
- if (this.value < 0 || this.value > 100) {
15355
- throw new Error("Invalid value for value");
15356
- }
15357
- if (this.targetValue < 0 || this.targetValue > 100) {
15358
- throw new Error("Invalid value for targetValue");
15359
- }
15360
- };
15361
- ProgressBarDeterminateComponent.ctorParameters = function () { return [
15362
- { type: LocaleService }
15363
- ]; };
15364
- __decorate([
15365
- core.Input()
15366
- ], ProgressBarDeterminateComponent.prototype, "value", void 0);
15367
- __decorate([
15368
- core.Input()
15369
- ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
15370
- __decorate([
15371
- core.Input()
15372
- ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
15373
- __decorate([
15374
- core.Input()
15375
- ], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
15376
- __decorate([
15377
- core.Input()
15378
- ], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
15379
- __decorate([
15380
- core.Input()
15381
- ], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
15382
- ProgressBarDeterminateComponent = __decorate([
15383
- core.Component({
15384
- selector: "s-progressbar-determinate",
15385
- 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",
15386
- 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}"]
15387
- })
15388
- ], ProgressBarDeterminateComponent);
15389
- return ProgressBarDeterminateComponent;
15390
- }());
15391
-
15392
- var ProgressBarIndeterminateComponent = /** @class */ (function () {
15393
- function ProgressBarIndeterminateComponent() {
15394
- }
15395
- __decorate([
15396
- core.Input()
15397
- ], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
15398
- __decorate([
15399
- core.Input()
15400
- ], ProgressBarIndeterminateComponent.prototype, "label", void 0);
15401
- ProgressBarIndeterminateComponent = __decorate([
15402
- core.Component({
15403
- selector: "s-progressbar-indeterminate",
15404
- 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",
15405
- 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%)}}"]
15406
- })
15407
- ], ProgressBarIndeterminateComponent);
15408
- return ProgressBarIndeterminateComponent;
15409
- }());
15410
-
15411
- var ProgressBarModule = /** @class */ (function () {
15412
- function ProgressBarModule() {
15413
- }
15414
- ProgressBarModule = __decorate([
15415
- core.NgModule({
15416
- imports: [common.CommonModule],
15417
- declarations: [
15418
- ProgressBarComponent,
15419
- ProgressBarDeterminateComponent,
15420
- ProgressBarIndeterminateComponent,
15421
- ],
15422
- exports: [ProgressBarComponent],
15423
- })
15424
- ], ProgressBarModule);
15425
- return ProgressBarModule;
15426
- }());
15427
-
15428
- var PanelComponent = /** @class */ (function () {
15429
- function PanelComponent() {
15430
- this.toggleable = true;
15431
- this.collapsed = false;
15432
- this.severity = exports.EnumSeverity.Default;
15433
- this.collapsedChange = new core.EventEmitter();
15434
- this.EnumSeverity = exports.EnumSeverity;
15435
- }
15436
- PanelComponent.prototype.onCollapsedChange = function (collapsed) {
15437
- this.collapsed = collapsed;
15438
- this.collapsedChange.emit(this.collapsed);
15439
- };
15440
- __decorate([
15441
- core.Input()
15442
- ], PanelComponent.prototype, "header", void 0);
15443
- __decorate([
15444
- core.Input()
15445
- ], PanelComponent.prototype, "toggleable", void 0);
15446
- __decorate([
15447
- core.Input()
15448
- ], PanelComponent.prototype, "collapsed", void 0);
15449
- __decorate([
15450
- core.Input()
15451
- ], PanelComponent.prototype, "severity", void 0);
15452
- __decorate([
15453
- core.Input()
15454
- ], PanelComponent.prototype, "borderButtonOptions", void 0);
15455
- __decorate([
15456
- core.Output()
15457
- ], PanelComponent.prototype, "collapsedChange", void 0);
15458
- PanelComponent = __decorate([
15279
+ core.HostListener("document:keydown", ["$event"])
15280
+ ], TieredMenuNestedComponent.prototype, "onKeydownHandler", null);
15281
+ TieredMenuNestedComponent = __decorate([
15459
15282
  core.Component({
15460
- selector: "s-panel",
15461
- 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>",
15462
- animations: [
15463
- animations.trigger("BorderButtonAnimation", [
15464
- animations.transition(":enter", [
15465
- animations.style({ transform: "scaleY(0)", opacity: 0 }),
15466
- animations.animate("300ms ease", animations.style({ transform: "scaleY(1)", opacity: 1 })),
15467
- ]),
15468
- animations.transition(":leave", [
15469
- animations.style({ transform: "scaleY(1)", opacity: 1 }),
15470
- animations.animate("300ms ease", animations.style({ transform: "scaleY(0)", opacity: 0 })),
15471
- ]),
15472
- ]),
15473
- ],
15474
- 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}"]
15475
- })
15476
- ], PanelComponent);
15477
- return PanelComponent;
15478
- }());
15479
-
15480
- var PanelModule = /** @class */ (function () {
15481
- function PanelModule() {
15482
- }
15483
- PanelModule = __decorate([
15484
- core.NgModule({
15485
- imports: [common.CommonModule, panel.PanelModule, BorderButtonModule],
15486
- declarations: [PanelComponent],
15487
- exports: [PanelComponent],
15283
+ 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",
15284
+ 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}"]
15488
15285
  })
15489
- ], PanelModule);
15490
- return PanelModule;
15286
+ ], TieredMenuNestedComponent);
15287
+ return TieredMenuNestedComponent;
15491
15288
  }());
15492
15289
 
15493
- var RatingScaleComponent = /** @class */ (function () {
15494
- function RatingScaleComponent() {
15495
- this.disabled = false;
15290
+ var TieredMenuComponent = /** @class */ (function () {
15291
+ function TieredMenuComponent(_appRef, _componentFactoryResolver, _injector, _changeDetectorRef, tieredMenuService, _tieredMenuEventService) {
15292
+ this._appRef = _appRef;
15293
+ this._componentFactoryResolver = _componentFactoryResolver;
15294
+ this._injector = _injector;
15295
+ this._changeDetectorRef = _changeDetectorRef;
15296
+ this.tieredMenuService = tieredMenuService;
15297
+ this._tieredMenuEventService = _tieredMenuEventService;
15298
+ this.top = 0;
15299
+ this.left = 0;
15300
+ this.menuTriggerEvent = "hover";
15301
+ this._componentRef = null;
15302
+ this._unsubscribe$ = new rxjs.Subject();
15303
+ this.destroyRequest = new core.EventEmitter();
15496
15304
  }
15497
- RatingScaleComponent_1 = RatingScaleComponent;
15498
- RatingScaleComponent.prototype.writeValue = function (value) {
15499
- if (!this.disabled) {
15500
- this.value = value;
15305
+ TieredMenuComponent_1 = TieredMenuComponent;
15306
+ TieredMenuComponent.prototype.onResize = function () {
15307
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
15308
+ };
15309
+ TieredMenuComponent.prototype.onDocumentClick = function (event) {
15310
+ // Closing menu when clicked outside.
15311
+ var target = event.target;
15312
+ var clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
15313
+ if (!clickedInside) {
15314
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
15501
15315
  }
15502
15316
  };
15503
- RatingScaleComponent.prototype.registerOnChange = function (onChange) {
15504
- this._onChange = onChange;
15317
+ TieredMenuComponent.prototype.onKeydownHandler = function (event) {
15318
+ switch (event.key) {
15319
+ case "Escape":
15320
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
15321
+ break;
15322
+ case " ":
15323
+ case "Enter":
15324
+ if (!this.tieredMenuService.currentItem.disabled) {
15325
+ this._tieredMenuEventService.selectItemEvent.emit(this.tieredMenuService.currentItem);
15326
+ }
15327
+ break;
15328
+ case "ArrowLeft":
15329
+ if (this.items.includes(this.tieredMenuService.currentItem)) {
15330
+ this._tieredMenuEventService.closeItemMenuEvent.emit(this.tieredMenuService.currentItem);
15331
+ this._changeDetectorRef.detectChanges();
15332
+ }
15333
+ break;
15334
+ case "ArrowRight":
15335
+ if (!this.tieredMenuService.currentItem.disabled && this.items.includes(this.tieredMenuService.currentItem)) {
15336
+ this._tieredMenuEventService.openItemMenuEvent.emit(this.tieredMenuService.currentItem);
15337
+ event.stopImmediatePropagation();
15338
+ }
15339
+ break;
15340
+ case "ArrowUp":
15341
+ if (!this.tieredMenuService.currentItem || this.items.includes(this.tieredMenuService.currentItem)) {
15342
+ this._tieredMenuEventService.decrementCurrentItemEvent.emit();
15343
+ event.stopImmediatePropagation();
15344
+ }
15345
+ break;
15346
+ case "ArrowDown":
15347
+ if (!this.tieredMenuService.currentItem || this.items.includes(this.tieredMenuService.currentItem)) {
15348
+ this._tieredMenuEventService.incrementCurrentItemEvent.emit();
15349
+ event.stopImmediatePropagation();
15350
+ }
15351
+ break;
15352
+ }
15505
15353
  };
15506
- RatingScaleComponent.prototype.registerOnTouched = function (onTouched) {
15507
- this._onTouched = onTouched;
15354
+ TieredMenuComponent.prototype.ngOnInit = function () {
15355
+ this.tieredMenuService.currentItems = this.items;
15356
+ this._subscribeEvents();
15508
15357
  };
15509
- RatingScaleComponent.prototype.onSelect = function (rating) {
15510
- this.value = rating;
15511
- if (this._onChange) {
15512
- this._onChange(this.value);
15358
+ TieredMenuComponent.prototype.ngOnDestroy = function () {
15359
+ this._unsubscribe$.next();
15360
+ this._unsubscribe$.complete();
15361
+ };
15362
+ TieredMenuComponent.prototype._incrementCurItem = function () {
15363
+ if (!this.tieredMenuService.currentItem) {
15364
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15365
+ return;
15366
+ }
15367
+ else if (!this.items.includes(this.tieredMenuService.currentItem)) {
15368
+ // Checking if it is the current menu.
15369
+ return;
15370
+ }
15371
+ var currentIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
15372
+ if (currentIndex < this.tieredMenuService.currentItems.length) {
15373
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[currentIndex];
15374
+ }
15375
+ else {
15376
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15377
+ }
15378
+ if (this.tieredMenuService.currentItem.divider) {
15379
+ this._incrementCurItem();
15513
15380
  }
15514
15381
  };
15515
- var RatingScaleComponent_1;
15382
+ TieredMenuComponent.prototype._decrementCurItem = function () {
15383
+ if (!this.tieredMenuService.currentItem) {
15384
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
15385
+ return;
15386
+ // Checking if it is the current menu.
15387
+ }
15388
+ else if (!this.items.includes(this.tieredMenuService.currentItem)) {
15389
+ return;
15390
+ }
15391
+ var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
15392
+ if (curIndex >= 0) {
15393
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
15394
+ }
15395
+ else {
15396
+ this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
15397
+ }
15398
+ if (this.tieredMenuService.currentItem.divider) {
15399
+ this._decrementCurItem();
15400
+ }
15401
+ };
15402
+ TieredMenuComponent.prototype._createMenu = function (items, position) {
15403
+ var _this = this;
15404
+ if (!this._componentRef && items) {
15405
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent_1);
15406
+ this._componentRef = componentFactory.create(this._injector);
15407
+ this._appRef.attachView(this._componentRef.hostView);
15408
+ var domElem = this._componentRef.hostView.rootNodes[0];
15409
+ document.body.appendChild(domElem);
15410
+ // Setting the menu items.
15411
+ this._componentRef.instance.items = items;
15412
+ // Subscribe menu events.
15413
+ this._componentRef.instance.destroyRequest.subscribe(function (propagate) {
15414
+ _this._destroy(propagate);
15415
+ });
15416
+ this._menuDivElement = domElem.querySelector(".menu");
15417
+ this._setMenuPosition(position);
15418
+ }
15419
+ };
15420
+ TieredMenuComponent.prototype._destroy = function (propagate) {
15421
+ if (propagate === void 0) { propagate = true; }
15422
+ if (this._componentRef !== null) {
15423
+ this._appRef.detachView(this._componentRef.hostView);
15424
+ this._componentRef.destroy();
15425
+ this._componentRef = null;
15426
+ this._menuDivElement = null;
15427
+ }
15428
+ if (propagate) {
15429
+ this.destroyRequest.emit();
15430
+ }
15431
+ };
15432
+ TieredMenuComponent.prototype._setMenuPosition = function (position) {
15433
+ var _a, _b;
15434
+ var ITEM_HEIGHT = 37;
15435
+ var DIVIDER_HEIGHT = 5;
15436
+ var PADDING = 8;
15437
+ if (this._componentRef !== null) {
15438
+ var top_1 = position.top, right = position.right, bottom = position.bottom, left = position.left;
15439
+ var itemsCount = (_a = this._componentRef.instance.items) === null || _a === void 0 ? void 0 : _a.reduce(function (count, item) {
15440
+ return !item.divider ? count + 1 : count;
15441
+ }, 0);
15442
+ var dividersCount = (_b = this._componentRef.instance.items) === null || _b === void 0 ? void 0 : _b.reduce(function (count, item) {
15443
+ return item.divider ? count + 1 : count;
15444
+ }, 0);
15445
+ // I need to calculate the height of the component because the internal elements have not been created yet.
15446
+ var menuHeight = itemsCount * ITEM_HEIGHT + dividersCount * DIVIDER_HEIGHT + PADDING + 8;
15447
+ var menuWidth = this._menuDivElement.getBoundingClientRect().width;
15448
+ var rightFreeSpace = window.innerWidth - right;
15449
+ var bottomFreeSpace = window.innerHeight - bottom;
15450
+ if (rightFreeSpace > menuWidth) {
15451
+ this._componentRef.instance.left = right;
15452
+ }
15453
+ else {
15454
+ this._componentRef.instance.left = left - menuWidth;
15455
+ }
15456
+ if (bottomFreeSpace <= menuHeight) {
15457
+ this._componentRef.instance.top = Math.max(window.innerHeight - menuHeight, window.scrollY);
15458
+ }
15459
+ else {
15460
+ this._componentRef.instance.top = window.scrollY + top_1;
15461
+ }
15462
+ }
15463
+ };
15464
+ TieredMenuComponent.prototype._subscribeEvents = function () {
15465
+ var _this = this;
15466
+ // Increment current item event.
15467
+ this._tieredMenuEventService.incrementCurrentItemEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
15468
+ _this._incrementCurItem();
15469
+ });
15470
+ // Decrement current item event.
15471
+ this._tieredMenuEventService.decrementCurrentItemEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
15472
+ _this._decrementCurItem();
15473
+ });
15474
+ // Select item event.
15475
+ this._tieredMenuEventService.selectItemEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function (item) {
15476
+ if (item.submenu) {
15477
+ _this._tieredMenuEventService.openItemMenuEvent.emit(item);
15478
+ }
15479
+ else if (item.command) {
15480
+ _this._tieredMenuEventService.closeAllMenusEvent.emit();
15481
+ item.command();
15482
+ }
15483
+ });
15484
+ // Close all menus event.
15485
+ this._tieredMenuEventService.closeAllMenusEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
15486
+ _this._destroy();
15487
+ _this.tieredMenuService.currentItem = null;
15488
+ _this.tieredMenuService.currentItems = _this.tieredMenuService.items;
15489
+ _this.tieredMenuService.markAllItemsAsClosed(_this.tieredMenuService.items);
15490
+ });
15491
+ // Open item menu event.
15492
+ this._tieredMenuEventService.openItemMenuEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function (item) {
15493
+ if (_this.tieredMenuService.currentItem) {
15494
+ if (_this.tieredMenuService.currentItem.parent === item) {
15495
+ return;
15496
+ }
15497
+ if (!_this.tieredMenuService.searchTheHierarchy(_this.tieredMenuService.currentItem.parent, item)) {
15498
+ var current = _this.tieredMenuService.currentItem;
15499
+ current.isOpen = false;
15500
+ while ((current === null || current === void 0 ? void 0 : current.parent) !== item.parent) {
15501
+ _this._tieredMenuEventService.closeItemMenuEvent.emit(current);
15502
+ _this._changeDetectorRef.detectChanges();
15503
+ current = current.parent;
15504
+ }
15505
+ if (current) {
15506
+ current.isOpen = false;
15507
+ }
15508
+ }
15509
+ }
15510
+ if (item.submenu && !item.isOpen && _this.items.includes(item)) {
15511
+ var _a = document.querySelector("#" + item.id).getBoundingClientRect(), top_2 = _a.top, right = _a.right, left = _a.left, bottom = _a.bottom;
15512
+ var position = { top: top_2, right: right, left: left, bottom: bottom };
15513
+ _this._createMenu(item.submenu, position);
15514
+ _this.tieredMenuService.currentItems = item.submenu;
15515
+ _this.tieredMenuService.currentItem = item.submenu[0];
15516
+ item.isOpen = true;
15517
+ }
15518
+ });
15519
+ // Close item menu event.
15520
+ this._tieredMenuEventService.closeItemMenuEvent
15521
+ .pipe(operators.takeUntil(this._unsubscribe$))
15522
+ .subscribe(function (item) {
15523
+ var _a, _b;
15524
+ if (_this.items.some(function (i) { return i.id === item.id; })) {
15525
+ if (item.parent) {
15526
+ item.parent.isOpen = false;
15527
+ }
15528
+ _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;
15529
+ _this.tieredMenuService.currentItem = item.parent;
15530
+ _this.destroyRequest.emit(false);
15531
+ }
15532
+ });
15533
+ };
15534
+ var TieredMenuComponent_1;
15535
+ TieredMenuComponent.ctorParameters = function () { return [
15536
+ { type: core.ApplicationRef },
15537
+ { type: core.ComponentFactoryResolver },
15538
+ { type: core.Injector },
15539
+ { type: core.ChangeDetectorRef },
15540
+ { type: TieredMenuService },
15541
+ { type: TieredMenuEventService }
15542
+ ]; };
15516
15543
  __decorate([
15517
- core.Input()
15518
- ], RatingScaleComponent.prototype, "nodes", void 0);
15544
+ core.Output()
15545
+ ], TieredMenuComponent.prototype, "destroyRequest", void 0);
15519
15546
  __decorate([
15520
- core.Input()
15521
- ], RatingScaleComponent.prototype, "startLabel", void 0);
15547
+ core.HostListener("window:resize")
15548
+ ], TieredMenuComponent.prototype, "onResize", null);
15522
15549
  __decorate([
15523
- core.Input()
15524
- ], RatingScaleComponent.prototype, "endLabel", void 0);
15550
+ core.HostListener("document:click", ["$event"])
15551
+ ], TieredMenuComponent.prototype, "onDocumentClick", null);
15525
15552
  __decorate([
15526
- core.Input()
15527
- ], RatingScaleComponent.prototype, "disabled", void 0);
15528
- RatingScaleComponent = RatingScaleComponent_1 = __decorate([
15553
+ core.HostListener("document:keydown", ["$event"])
15554
+ ], TieredMenuComponent.prototype, "onKeydownHandler", null);
15555
+ TieredMenuComponent = TieredMenuComponent_1 = __decorate([
15529
15556
  core.Component({
15530
- selector: "s-rating-scale",
15531
- 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>",
15532
- providers: [{
15533
- provide: forms.NG_VALUE_ACCESSOR,
15534
- useExisting: core.forwardRef(function () { return RatingScaleComponent_1; }),
15535
- multi: true,
15536
- }],
15537
- 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}"]
15557
+ selector: "s-tiered-menu",
15558
+ 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>",
15559
+ 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}"]
15538
15560
  })
15539
- ], RatingScaleComponent);
15540
- return RatingScaleComponent;
15561
+ ], TieredMenuComponent);
15562
+ return TieredMenuComponent;
15541
15563
  }());
15542
15564
 
15543
- var RatingScaleModule = /** @class */ (function () {
15544
- function RatingScaleModule() {
15565
+ var TieredMenuGlobalService = /** @class */ (function () {
15566
+ function TieredMenuGlobalService() {
15545
15567
  }
15546
- RatingScaleModule = __decorate([
15547
- core.NgModule({
15548
- imports: [
15549
- common.CommonModule,
15550
- forms.ReactiveFormsModule,
15551
- ],
15552
- declarations: [RatingScaleComponent],
15553
- exports: [RatingScaleComponent],
15554
- })
15555
- ], RatingScaleModule);
15556
- return RatingScaleModule;
15568
+ TieredMenuGlobalService = __decorate([
15569
+ core.Injectable()
15570
+ ], TieredMenuGlobalService);
15571
+ return TieredMenuGlobalService;
15557
15572
  }());
15558
15573
 
15559
- var SelectButtonComponent = /** @class */ (function () {
15560
- function SelectButtonComponent() {
15561
- this.multiple = false;
15562
- this.itemSelected = new core.EventEmitter();
15563
- this.itemClicked = new core.EventEmitter();
15564
- this.disabled = false;
15565
- this.activeItems = new Set();
15574
+ var TieredMenuDirective = /** @class */ (function () {
15575
+ function TieredMenuDirective(_elementRef, _appRef, _componentFactoryResolver, _injector, _tieredMenuEventService, _tieredMenuService, _tieredMenuGlobalService, _changeDetectorRef) {
15576
+ this._elementRef = _elementRef;
15577
+ this._appRef = _appRef;
15578
+ this._componentFactoryResolver = _componentFactoryResolver;
15579
+ this._injector = _injector;
15580
+ this._tieredMenuEventService = _tieredMenuEventService;
15581
+ this._tieredMenuService = _tieredMenuService;
15582
+ this._tieredMenuGlobalService = _tieredMenuGlobalService;
15583
+ this._changeDetectorRef = _changeDetectorRef;
15584
+ this.items = [];
15585
+ this.triggerEvent = "click";
15586
+ this._componentRef = null;
15587
+ this._isNested = false;
15588
+ this._isOpen = false;
15589
+ this._unsubscribe$ = new rxjs.Subject();
15566
15590
  }
15567
- SelectButtonComponent_1 = SelectButtonComponent;
15568
- SelectButtonComponent.prototype.writeValue = function (value) {
15569
- var _this = this;
15570
- if (!value)
15571
- return;
15572
- this.activeItems.clear();
15573
- if (Array.isArray(value)) {
15574
- value.forEach(function (item) {
15575
- _this.items.forEach(function (iItem) {
15576
- if (_this._compareItems(item, iItem)) {
15577
- _this.activeItems.add(iItem);
15578
- }
15579
- });
15580
- });
15591
+ TieredMenuDirective.prototype.onClick = function (event) {
15592
+ if (this.triggerEvent === "click" && !this._isOpen) {
15593
+ this._lastActiveElement = document.activeElement;
15594
+ this._createMenu();
15595
+ event.preventDefault();
15596
+ event.stopPropagation();
15597
+ }
15598
+ };
15599
+ TieredMenuDirective.prototype.ngOnInit = function () {
15600
+ this._subscribeEvents();
15601
+ };
15602
+ TieredMenuDirective.prototype.ngDoCheck = function () {
15603
+ if (!this.previousItems) {
15604
+ this.previousItems = this._tieredMenuService.cloneItems(this.items);
15605
+ }
15606
+ var hasChanges = false;
15607
+ if (this.items.length !== this.previousItems.length) {
15608
+ hasChanges = true;
15581
15609
  }
15582
15610
  else {
15583
- this.items.forEach(function (iItem) {
15584
- if (_this._compareItems(value, iItem)) {
15585
- _this.activeItems.add(iItem);
15611
+ for (var i = 0; i < this.items.length; i++) {
15612
+ if (!this._compareItems(this.items[i], this.previousItems[i])) {
15613
+ hasChanges = true;
15614
+ break;
15586
15615
  }
15587
- });
15616
+ }
15617
+ }
15618
+ if (hasChanges) {
15619
+ this._updateServiceItems();
15620
+ this._changeDetectorRef.detectChanges();
15621
+ this._rebuildMenu();
15588
15622
  }
15623
+ this.previousItems = this._tieredMenuService.cloneItems(this.items);
15589
15624
  };
15590
- SelectButtonComponent.prototype.registerOnChange = function (onChange) {
15591
- this.onChange = onChange;
15625
+ TieredMenuDirective.prototype.ngOnDestroy = function () {
15626
+ this._unsubscribe$.next();
15627
+ this._unsubscribe$.complete();
15628
+ this._destroy();
15592
15629
  };
15593
- SelectButtonComponent.prototype.registerOnTouched = function (onTouched) {
15594
- this.onTouched = onTouched;
15630
+ TieredMenuDirective.prototype._createMenu = function () {
15631
+ var _a, _b, _c;
15632
+ this._updateServiceItems();
15633
+ if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
15634
+ (_b = this._tieredMenuGlobalService.lastInstance) === null || _b === void 0 ? void 0 : _b._destroy();
15635
+ this._tieredMenuGlobalService.lastInstance = this;
15636
+ (_c = this._lastActiveElement) === null || _c === void 0 ? void 0 : _c.blur();
15637
+ this._isOpen = true;
15638
+ this._isNested = document.body.clientWidth < 600;
15639
+ this._isNested ? this._createNestedMenu() : this._createTieredMenu();
15640
+ }
15595
15641
  };
15596
- SelectButtonComponent.prototype.setDisabledState = function (disabled) {
15597
- this.disabled = disabled;
15642
+ TieredMenuDirective.prototype._createTieredMenu = function () {
15643
+ var _this = this;
15644
+ var _a;
15645
+ if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
15646
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent);
15647
+ this._componentRef = componentFactory.create(this._injector);
15648
+ this._appRef.attachView(this._componentRef.hostView);
15649
+ var domElem = this._componentRef.hostView.rootNodes[0];
15650
+ document.body.appendChild(domElem);
15651
+ this._setMenuComponentProperties();
15652
+ this._componentRef.instance.destroyRequest.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
15653
+ _this._destroy();
15654
+ });
15655
+ this._setMenuPosition();
15656
+ }
15598
15657
  };
15599
- SelectButtonComponent.prototype.onItemSelect = function (item) {
15600
- var _a, _b;
15601
- if (this.disabled || item.disabled)
15602
- return;
15603
- this.itemClicked.emit(item);
15604
- if (!this.multiple) {
15605
- this.activeItems.clear();
15658
+ TieredMenuDirective.prototype._createNestedMenu = function () {
15659
+ var _a;
15660
+ if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
15661
+ var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuNestedComponent);
15662
+ this._componentRef = componentFactory.create(this._injector);
15663
+ this._appRef.attachView(this._componentRef.hostView);
15664
+ var domElem = this._componentRef.hostView.rootNodes[0];
15665
+ document.body.appendChild(domElem);
15666
+ this._setMenuComponentProperties();
15667
+ this._setMenuPosition();
15606
15668
  }
15607
- this.activeItems.add(item);
15608
- this.itemSelected.emit(__spread(this.activeItems));
15609
- (_a = this.onChange) === null || _a === void 0 ? void 0 : _a.call(this, __spread(this.activeItems));
15610
- (_b = this.onTouched) === null || _b === void 0 ? void 0 : _b.call(this, __spread(this.activeItems));
15611
15669
  };
15612
- SelectButtonComponent.prototype._compareItems = function (item1, item2) {
15613
- var _compare = function (a, b) {
15614
- var e_1, _a;
15615
- if (a === b) {
15616
- return true;
15617
- }
15618
- if (a === undefined || b === undefined || typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
15619
- return false;
15620
- }
15621
- if (Array.isArray(a) !== Array.isArray(b)) {
15622
- return false;
15670
+ TieredMenuDirective.prototype._destroy = function () {
15671
+ if (this._componentRef) {
15672
+ this._isOpen = false;
15673
+ window.clearTimeout(this._showTimeout);
15674
+ this._appRef.detachView(this._componentRef.hostView);
15675
+ this._componentRef.destroy();
15676
+ this._componentRef = null;
15677
+ this._tieredMenuService.currentItems = this._tieredMenuService.items;
15678
+ this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
15679
+ this._tieredMenuEventService.closeAllMenusEvent.emit();
15680
+ }
15681
+ };
15682
+ TieredMenuDirective.prototype._setMenuPosition = function () {
15683
+ var _a, _b;
15684
+ var ITEM_HEIGHT = 37;
15685
+ var ITEM_WIDTH = 176;
15686
+ var DIVIDER_HEIGHT = 5;
15687
+ var PADDING = 8;
15688
+ var MARGIN = 4;
15689
+ if (this._componentRef !== null) {
15690
+ this._componentRef.instance.top = 8;
15691
+ var _c = this._elementRef.nativeElement.getBoundingClientRect(), bottom = _c.bottom, left = _c.left, right = _c.right;
15692
+ var itemsCount = (_a = this._componentRef.instance.items) === null || _a === void 0 ? void 0 : _a.reduce(function (count, item) {
15693
+ return !item.divider ? count + 1 : count;
15694
+ }, 0);
15695
+ var dividersCount = (_b = this._componentRef.instance.items) === null || _b === void 0 ? void 0 : _b.reduce(function (count, item) {
15696
+ return item.divider ? count + 1 : count;
15697
+ }, 0);
15698
+ var menuHeight = itemsCount * ITEM_HEIGHT + dividersCount * DIVIDER_HEIGHT + PADDING + MARGIN;
15699
+ var rightFreeSpace = window.innerWidth - right;
15700
+ var bottomFreeSpace = window.innerHeight - bottom;
15701
+ this._componentRef.instance.top = bottom;
15702
+ this._componentRef.instance.left = left;
15703
+ if (bottomFreeSpace <= menuHeight) {
15704
+ this._componentRef.instance.top = Math.max(scrollY + bottom - menuHeight, 0);
15623
15705
  }
15624
- var keysA = Object.keys(a);
15625
- var keysB = Object.keys(b);
15626
- if (keysA.length !== keysB.length) {
15627
- return false;
15706
+ else {
15707
+ this._componentRef.instance.top = window.scrollY + bottom + MARGIN;
15628
15708
  }
15629
- try {
15630
- for (var keysA_1 = __values(keysA), keysA_1_1 = keysA_1.next(); !keysA_1_1.done; keysA_1_1 = keysA_1.next()) {
15631
- var key = keysA_1_1.value;
15632
- if (!keysB.includes(key) || !_compare(a[key], b[key])) {
15633
- return false;
15634
- }
15635
- }
15709
+ if (rightFreeSpace > 176) {
15710
+ this._componentRef.instance.left = window.scrollX + left;
15636
15711
  }
15637
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
15638
- finally {
15639
- try {
15640
- if (keysA_1_1 && !keysA_1_1.done && (_a = keysA_1.return)) _a.call(keysA_1);
15641
- }
15642
- finally { if (e_1) throw e_1.error; }
15712
+ else {
15713
+ this._componentRef.instance.left = window.scrollX + right - ITEM_WIDTH;
15643
15714
  }
15644
- for (var key in a) {
15645
- if (a.hasOwnProperty(key) !== b.hasOwnProperty(key)) {
15646
- return false;
15647
- }
15715
+ if (this._isNested) {
15716
+ this._componentRef.instance.left = MARGIN;
15648
15717
  }
15649
- return true;
15650
- };
15651
- return _compare(item1, item2);
15718
+ }
15652
15719
  };
15653
- var SelectButtonComponent_1;
15720
+ TieredMenuDirective.prototype._setMenuComponentProperties = function () {
15721
+ if (this._componentRef != null) {
15722
+ this._componentRef.instance.items = this._tieredMenuService.items;
15723
+ }
15724
+ };
15725
+ TieredMenuDirective.prototype._subscribeEvents = function () {
15726
+ var _this = this;
15727
+ this._tieredMenuEventService.closeAllMenusEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
15728
+ _this._tieredMenuService.items = _this._tieredMenuService.markAllItemsAsClosed(_this._tieredMenuService.items);
15729
+ _this._destroy();
15730
+ });
15731
+ };
15732
+ TieredMenuDirective.prototype._compareItems = function (item1, item2) {
15733
+ return JSON.stringify(item1) === JSON.stringify(item2);
15734
+ };
15735
+ TieredMenuDirective.prototype._rebuildMenu = function () {
15736
+ this._destroy();
15737
+ };
15738
+ TieredMenuDirective.prototype._updateServiceItems = function () {
15739
+ this._tieredMenuService.items = this._tieredMenuService.normalizeData(this.items);
15740
+ this._tieredMenuService.currentItems = this._tieredMenuService.items;
15741
+ this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
15742
+ };
15743
+ TieredMenuDirective.ctorParameters = function () { return [
15744
+ { type: core.ElementRef },
15745
+ { type: core.ApplicationRef },
15746
+ { type: core.ComponentFactoryResolver },
15747
+ { type: core.Injector },
15748
+ { type: TieredMenuEventService },
15749
+ { type: TieredMenuService },
15750
+ { type: TieredMenuGlobalService },
15751
+ { type: core.ChangeDetectorRef }
15752
+ ]; };
15654
15753
  __decorate([
15655
15754
  core.Input()
15656
- ], SelectButtonComponent.prototype, "items", void 0);
15755
+ ], TieredMenuDirective.prototype, "items", void 0);
15657
15756
  __decorate([
15658
15757
  core.Input()
15659
- ], SelectButtonComponent.prototype, "multiple", void 0);
15660
- __decorate([
15661
- core.Output()
15662
- ], SelectButtonComponent.prototype, "itemSelected", void 0);
15758
+ ], TieredMenuDirective.prototype, "triggerEvent", void 0);
15663
15759
  __decorate([
15664
- core.Output()
15665
- ], SelectButtonComponent.prototype, "itemClicked", void 0);
15666
- SelectButtonComponent = SelectButtonComponent_1 = __decorate([
15667
- core.Component({
15668
- selector: "s-select-button",
15669
- 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>",
15670
- providers: [
15671
- {
15672
- provide: forms.NG_VALUE_ACCESSOR,
15673
- useExisting: core.forwardRef(function () { return SelectButtonComponent_1; }),
15674
- multi: true,
15675
- },
15760
+ core.HostListener("click", ["$event"])
15761
+ ], TieredMenuDirective.prototype, "onClick", null);
15762
+ TieredMenuDirective = __decorate([
15763
+ core.Directive({
15764
+ selector: "[sTieredMenu]",
15765
+ providers: [TieredMenuEventService, TieredMenuService],
15766
+ })
15767
+ ], TieredMenuDirective);
15768
+ return TieredMenuDirective;
15769
+ }());
15770
+
15771
+ var TieredMenuModule = /** @class */ (function () {
15772
+ function TieredMenuModule() {
15773
+ }
15774
+ TieredMenuModule = __decorate([
15775
+ core.NgModule({
15776
+ imports: [
15777
+ common.CommonModule,
15676
15778
  ],
15677
- styles: [".select-button{overflow:hidden}"]
15779
+ declarations: [
15780
+ TieredMenuDirective,
15781
+ TieredMenuComponent,
15782
+ TieredMenuNestedComponent,
15783
+ TieredMenuItemComponent,
15784
+ TieredMenuDividerComponent,
15785
+ ],
15786
+ exports: [TieredMenuDirective],
15787
+ providers: [TieredMenuGlobalService],
15678
15788
  })
15679
- ], SelectButtonComponent);
15680
- return SelectButtonComponent;
15789
+ ], TieredMenuModule);
15790
+ return TieredMenuModule;
15681
15791
  }());
15682
15792
 
15683
- var SelectButtonItemComponent = /** @class */ (function () {
15684
- function SelectButtonItemComponent() {
15685
- this.active = false;
15686
- this.first = false;
15687
- this.last = false;
15688
- this.disabled = false;
15793
+ var NavigationButtonModule = /** @class */ (function () {
15794
+ function NavigationButtonModule() {
15795
+ }
15796
+ NavigationButtonModule = __decorate([
15797
+ core.NgModule({
15798
+ imports: [common.CommonModule, TieredMenuModule, TooltipModule],
15799
+ declarations: [NavigationButtonComponent],
15800
+ exports: [NavigationButtonComponent],
15801
+ })
15802
+ ], NavigationButtonModule);
15803
+ return NavigationButtonModule;
15804
+ }());
15805
+
15806
+ var ObjectCardFieldComponent = /** @class */ (function () {
15807
+ function ObjectCardFieldComponent() {
15808
+ this.id = "s-object-card-field-" + ObjectCardFieldComponent_1.nextId++;
15809
+ this.buttonClick = new core.EventEmitter();
15689
15810
  }
15811
+ ObjectCardFieldComponent_1 = ObjectCardFieldComponent;
15812
+ var ObjectCardFieldComponent_1;
15813
+ ObjectCardFieldComponent.nextId = 0;
15690
15814
  __decorate([
15691
15815
  core.Input()
15692
- ], SelectButtonItemComponent.prototype, "label", void 0);
15816
+ ], ObjectCardFieldComponent.prototype, "id", void 0);
15693
15817
  __decorate([
15694
15818
  core.Input()
15695
- ], SelectButtonItemComponent.prototype, "active", void 0);
15819
+ ], ObjectCardFieldComponent.prototype, "imageSource", void 0);
15696
15820
  __decorate([
15697
15821
  core.Input()
15698
- ], SelectButtonItemComponent.prototype, "first", void 0);
15822
+ ], ObjectCardFieldComponent.prototype, "imageAlt", void 0);
15699
15823
  __decorate([
15700
15824
  core.Input()
15701
- ], SelectButtonItemComponent.prototype, "last", void 0);
15825
+ ], ObjectCardFieldComponent.prototype, "iconClass", void 0);
15702
15826
  __decorate([
15703
15827
  core.Input()
15704
- ], SelectButtonItemComponent.prototype, "disabled", void 0);
15705
- SelectButtonItemComponent = __decorate([
15828
+ ], ObjectCardFieldComponent.prototype, "label", void 0);
15829
+ __decorate([
15830
+ core.Input()
15831
+ ], ObjectCardFieldComponent.prototype, "description", void 0);
15832
+ __decorate([
15833
+ core.Input()
15834
+ ], ObjectCardFieldComponent.prototype, "buttonLabel", void 0);
15835
+ __decorate([
15836
+ core.Input()
15837
+ ], ObjectCardFieldComponent.prototype, "buttonModel", void 0);
15838
+ __decorate([
15839
+ core.Output()
15840
+ ], ObjectCardFieldComponent.prototype, "buttonClick", void 0);
15841
+ __decorate([
15842
+ core.ContentChild(ThumbnailComponent, { static: true })
15843
+ ], ObjectCardFieldComponent.prototype, "thumbnailComponent", void 0);
15844
+ __decorate([
15845
+ core.ViewChild(core.TemplateRef, { static: true })
15846
+ ], ObjectCardFieldComponent.prototype, "content", void 0);
15847
+ ObjectCardFieldComponent = ObjectCardFieldComponent_1 = __decorate([
15706
15848
  core.Component({
15707
- selector: "s-select-button-item",
15708
- 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>",
15709
- 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}"]
15710
- })
15711
- ], SelectButtonItemComponent);
15712
- return SelectButtonItemComponent;
15713
- }());
15714
-
15715
- var SelectButtonModule = /** @class */ (function () {
15716
- function SelectButtonModule() {
15717
- }
15718
- SelectButtonModule = __decorate([
15719
- core.NgModule({
15720
- imports: [common.CommonModule],
15721
- declarations: [
15722
- SelectButtonComponent,
15723
- SelectButtonItemComponent,
15724
- ],
15725
- exports: [SelectButtonComponent],
15849
+ selector: "s-object-card-field",
15850
+ 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",
15851
+ 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}"]
15726
15852
  })
15727
- ], SelectButtonModule);
15728
- return SelectButtonModule;
15853
+ ], ObjectCardFieldComponent);
15854
+ return ObjectCardFieldComponent;
15729
15855
  }());
15730
15856
 
15731
- var SidebarComponent = /** @class */ (function () {
15732
- function SidebarComponent(focusTrapFactory) {
15733
- this.focusTrapFactory = focusTrapFactory;
15734
- this.id = "s-sidebar-" + SidebarComponent_1.nextId++;
15735
- this.visible = false;
15736
- this.baseZIndex = 0;
15737
- this.largeSized = false;
15738
- this.visibleChange = new core.EventEmitter();
15857
+ var ObjectCardMainComponent = /** @class */ (function () {
15858
+ function ObjectCardMainComponent() {
15859
+ this.id = "s-object-card-main-" + ObjectCardMainComponent_1.nextId++;
15860
+ this.iconClass = "fa fa-picture-o";
15861
+ this.hasThumbnail = true;
15862
+ this.hasDescription = true;
15863
+ this.isBrand = false;
15864
+ this.buttonClick = new core.EventEmitter();
15865
+ this._thumbnailSize = exports.ThumbnailSize.Medium;
15739
15866
  }
15740
- SidebarComponent_1 = SidebarComponent;
15741
- SidebarComponent.prototype.onShow = function () {
15742
- dom.DomHandler.addClass(document.body, "ui-overflow-hidden-sidebar");
15743
- var focusTrap = this.focusTrapFactory.create(this.innerSidebar.containerViewChild.nativeElement, false);
15744
- focusTrap.focusInitialElementWhenReady();
15867
+ ObjectCardMainComponent_1 = ObjectCardMainComponent;
15868
+ Object.defineProperty(ObjectCardMainComponent.prototype, "thumbnailSize", {
15869
+ get: function () {
15870
+ return this._thumbnailSize;
15871
+ },
15872
+ set: function (value) {
15873
+ this._thumbnailSize = value;
15874
+ if (this.thumbnailComponent)
15875
+ this.thumbnailComponent.size = value;
15876
+ },
15877
+ enumerable: true,
15878
+ configurable: true
15879
+ });
15880
+ ObjectCardMainComponent.prototype.onResize = function () {
15881
+ this.update();
15745
15882
  };
15746
- SidebarComponent.prototype.onHide = function () {
15747
- dom.DomHandler.removeClass(document.body, "ui-overflow-hidden-sidebar");
15883
+ ObjectCardMainComponent.prototype.ngAfterContentInit = function () {
15884
+ this.update();
15748
15885
  };
15749
- SidebarComponent.prototype.close = function (event) {
15750
- dom.DomHandler.removeClass(document.body, "ui-overflow-hidden-sidebar");
15751
- this.visibleChange.emit(false);
15752
- event.preventDefault();
15886
+ ObjectCardMainComponent.prototype.update = function () {
15887
+ var windowWidth = window.innerWidth;
15888
+ if (windowWidth <= Breakpoints.SM_MAX)
15889
+ this.thumbnailSize = exports.ThumbnailSize.Small;
15890
+ else
15891
+ this.thumbnailSize = exports.ThumbnailSize.Medium;
15753
15892
  };
15754
- var SidebarComponent_1;
15755
- SidebarComponent.nextId = 0;
15756
- SidebarComponent.ctorParameters = function () { return [
15757
- { type: a11y.FocusTrapFactory }
15758
- ]; };
15893
+ var ObjectCardMainComponent_1;
15894
+ ObjectCardMainComponent.nextId = 0;
15759
15895
  __decorate([
15760
15896
  core.Input()
15761
- ], SidebarComponent.prototype, "id", void 0);
15897
+ ], ObjectCardMainComponent.prototype, "id", void 0);
15762
15898
  __decorate([
15763
15899
  core.Input()
15764
- ], SidebarComponent.prototype, "visible", void 0);
15900
+ ], ObjectCardMainComponent.prototype, "imageSource", void 0);
15765
15901
  __decorate([
15766
15902
  core.Input()
15767
- ], SidebarComponent.prototype, "header", void 0);
15903
+ ], ObjectCardMainComponent.prototype, "imageFallback", void 0);
15768
15904
  __decorate([
15769
15905
  core.Input()
15770
- ], SidebarComponent.prototype, "baseZIndex", void 0);
15906
+ ], ObjectCardMainComponent.prototype, "imageAlt", void 0);
15907
+ __decorate([
15908
+ core.Input()
15909
+ ], ObjectCardMainComponent.prototype, "iconClass", void 0);
15910
+ __decorate([
15911
+ core.Input()
15912
+ ], ObjectCardMainComponent.prototype, "hasThumbnail", void 0);
15913
+ __decorate([
15914
+ core.Input()
15915
+ ], ObjectCardMainComponent.prototype, "hasDescription", void 0);
15916
+ __decorate([
15917
+ core.Input()
15918
+ ], ObjectCardMainComponent.prototype, "isBrand", void 0);
15919
+ __decorate([
15920
+ core.Input()
15921
+ ], ObjectCardMainComponent.prototype, "label", void 0);
15922
+ __decorate([
15923
+ core.Input()
15924
+ ], ObjectCardMainComponent.prototype, "description", void 0);
15925
+ __decorate([
15926
+ core.Input()
15927
+ ], ObjectCardMainComponent.prototype, "buttonLabel", void 0);
15771
15928
  __decorate([
15772
15929
  core.Input()
15773
- ], SidebarComponent.prototype, "largeSized", void 0);
15930
+ ], ObjectCardMainComponent.prototype, "buttonModel", void 0);
15774
15931
  __decorate([
15775
15932
  core.Output()
15776
- ], SidebarComponent.prototype, "visibleChange", void 0);
15777
- __decorate([
15778
- core.ViewChild(sidebar.Sidebar, { static: true })
15779
- ], SidebarComponent.prototype, "innerSidebar", void 0);
15933
+ ], ObjectCardMainComponent.prototype, "buttonClick", void 0);
15780
15934
  __decorate([
15781
- core.ContentChild(HeaderComponent, { static: true })
15782
- ], SidebarComponent.prototype, "headerSection", void 0);
15935
+ core.ContentChild(ThumbnailComponent, { static: true })
15936
+ ], ObjectCardMainComponent.prototype, "thumbnailComponent", void 0);
15783
15937
  __decorate([
15784
- core.ContentChild(FooterComponent, { static: true })
15785
- ], SidebarComponent.prototype, "footerSection", void 0);
15786
- SidebarComponent = SidebarComponent_1 = __decorate([
15938
+ core.HostListener("window:resize")
15939
+ ], ObjectCardMainComponent.prototype, "onResize", null);
15940
+ ObjectCardMainComponent = ObjectCardMainComponent_1 = __decorate([
15787
15941
  core.Component({
15788
- selector: "s-sidebar",
15789
- 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",
15790
- encapsulation: core.ViewEncapsulation.None,
15791
- 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}"]
15942
+ selector: "s-object-card-main",
15943
+ 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",
15944
+ 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}}"]
15792
15945
  })
15793
- ], SidebarComponent);
15794
- return SidebarComponent;
15946
+ ], ObjectCardMainComponent);
15947
+ return ObjectCardMainComponent;
15795
15948
  }());
15796
15949
 
15797
- var SidebarModule = /** @class */ (function () {
15798
- function SidebarModule() {
15799
- }
15800
- SidebarModule = __decorate([
15801
- core.NgModule({
15802
- imports: [common.CommonModule, a11y.A11yModule, sidebar.SidebarModule, scrollpanel.ScrollPanelModule, StructureModule],
15803
- declarations: [SidebarComponent],
15804
- exports: [StructureModule, SidebarComponent],
15805
- })
15806
- ], SidebarModule);
15807
- return SidebarModule;
15808
- }());
15809
15950
 
15810
- var SlidePanelService = /** @class */ (function () {
15811
- function SlidePanelService() {
15812
- this.modalCloseMap = new Map();
15813
- }
15814
- SlidePanelService.prototype.createSlidePanel = function (id) {
15815
- var panelSubject = new rxjs.Subject();
15816
- this.modalCloseMap.set(id, panelSubject);
15817
- return panelSubject.asObservable();
15818
- };
15819
- SlidePanelService.prototype.getModalCloseObservable = function (id) {
15820
- return this.modalCloseMap.get(id).asObservable();
15821
- };
15822
- SlidePanelService.prototype.closeModal = function (id) {
15823
- var subject = this.modalCloseMap.get(id);
15824
- if (subject) {
15825
- subject.next();
15826
- }
15827
- };
15828
- SlidePanelService = __decorate([
15829
- core.Injectable()
15830
- ], SlidePanelService);
15831
- return SlidePanelService;
15832
- }());
15951
+ (function (EnumSeverity) {
15952
+ EnumSeverity["Default"] = "Default";
15953
+ EnumSeverity["Info"] = "Info";
15954
+ EnumSeverity["Warn"] = "Warn";
15955
+ EnumSeverity["Error"] = "Error";
15956
+ EnumSeverity["Success"] = "Success";
15957
+ })(exports.EnumSeverity || (exports.EnumSeverity = {}));
15833
15958
 
15834
- var SMALL_DEVICE_BREAKPOINT = 420;
15835
- var SlidePanelComponent = /** @class */ (function () {
15836
- function SlidePanelComponent(slidePanelService) {
15837
- this.slidePanelService = slidePanelService;
15838
- this.id = "slide-panel-" + ++SlidePanelComponent_1.nextId;
15839
- this.openIcon = "fas fa-chevron-right";
15840
- this.closeIcon = "fas fa-chevron-left";
15841
- this.cache = false;
15842
- this.createOpen = false;
15843
- this.panelOpened = new core.EventEmitter();
15844
- this.panelClosed = new core.EventEmitter();
15845
- this.isOpen = false;
15846
- this.isSlideOver = false;
15847
- this.isAnimating = false;
15848
- this.isContentAnimationDisabled = true;
15849
- this.slideHeight = 0;
15850
- this.sideContentWidth = 0;
15851
- this._unsubscribe$ = new rxjs.Subject();
15959
+ var elementResizeDetectorMaker = elementResizeDetectorMaker_; // @HACK Necessary because of https://github.com/rollup/rollup/issues/670
15960
+ var ObjectCardComponent = /** @class */ (function () {
15961
+ function ObjectCardComponent(cdr, elementRef) {
15962
+ this.cdr = cdr;
15963
+ this.elementRef = elementRef;
15964
+ this.id = "s-object-card-" + ObjectCardComponent_1.nextId++;
15965
+ this.expanded = false;
15966
+ this.expandTooltip = "Abrir painel";
15967
+ this.collapseTooltip = "Fechar painel";
15968
+ this.fieldsMinWidth = 200;
15969
+ this.expandedChange = new core.EventEmitter();
15970
+ this.maxVisibleFields = 0;
15971
+ this.severity = exports.EnumSeverity.Default;
15972
+ this.EnumSeverity = exports.EnumSeverity;
15852
15973
  }
15853
- SlidePanelComponent_1 = SlidePanelComponent;
15854
- SlidePanelComponent.prototype.onResize = function () {
15855
- this._checkOverBehavior();
15856
- };
15857
- SlidePanelComponent.prototype.ngOnInit = function () {
15858
- var _this = this;
15859
- this._checkOverBehavior();
15860
- this.slidePanelService.createSlidePanel(this.id)
15861
- .pipe(operators.takeUntil(this._unsubscribe$))
15862
- .subscribe(function () {
15863
- _this.isOpen = false;
15864
- });
15865
- };
15866
- SlidePanelComponent.prototype.ngAfterViewInit = function () {
15974
+ ObjectCardComponent_1 = ObjectCardComponent;
15975
+ ObjectCardComponent.prototype.ngAfterViewInit = function () {
15867
15976
  var _this = this;
15868
- queueMicrotask(function () {
15869
- if (_this.createOpen) {
15870
- _this.isOpen = true;
15871
- }
15977
+ this.update();
15978
+ this.cdr.detectChanges();
15979
+ this.fields.changes.subscribe(function () {
15980
+ _this.update();
15872
15981
  });
15873
- };
15874
- SlidePanelComponent.prototype.ngAfterViewChecked = function () {
15875
- var _this = this;
15876
- // to executed at a safe time prior to control returning to the browser's event loop
15877
- queueMicrotask(function () {
15878
- _this._calculateSlideHeight();
15879
- _this._calculateSideContentWidth();
15880
- _this.isContentAnimationDisabled = false;
15982
+ var erd = elementResizeDetectorMaker({
15983
+ strategy: "scroll",
15881
15984
  });
15985
+ erd.listenTo(this.elementRef.nativeElement, function () { return _this.update(); });
15882
15986
  };
15883
- SlidePanelComponent.prototype.ngOnDestroy = function () {
15884
- this._unsubscribe$.next();
15885
- this._unsubscribe$.complete();
15886
- };
15887
- SlidePanelComponent.prototype.onClickButton = function () {
15888
- if (this.isAnimating) {
15889
- return;
15987
+ ObjectCardComponent.prototype.update = function () {
15988
+ var e_1, _a;
15989
+ var windowWidth = window.innerWidth;
15990
+ var containerWidth = this.elementRef.nativeElement.offsetWidth;
15991
+ var mainFieldWidth = containerWidth * 0.3 > 260 ? containerWidth * 0.3 : 260;
15992
+ var fieldsMinWidth = this.fieldsMinWidth;
15993
+ var expandIconWidth = 50;
15994
+ var fieldElementList = this.elementRef.nativeElement.getElementsByClassName("s-object-card-field");
15995
+ try {
15996
+ for (var fieldElementList_1 = __values(fieldElementList), fieldElementList_1_1 = fieldElementList_1.next(); !fieldElementList_1_1.done; fieldElementList_1_1 = fieldElementList_1.next()) {
15997
+ var element = fieldElementList_1_1.value;
15998
+ element.style.minWidth = this.fieldsMinWidth + "px";
15999
+ }
15890
16000
  }
15891
- this.isOpen = !this.isOpen;
15892
- if (this.isOpen) {
15893
- this.panelOpened.emit();
16001
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
16002
+ finally {
16003
+ try {
16004
+ if (fieldElementList_1_1 && !fieldElementList_1_1.done && (_a = fieldElementList_1.return)) _a.call(fieldElementList_1);
16005
+ }
16006
+ finally { if (e_1) throw e_1.error; }
15894
16007
  }
15895
- else {
15896
- this.panelClosed.emit();
16008
+ var maxFieldQtd;
16009
+ if (windowWidth <= Breakpoints.SM_MAX)
16010
+ maxFieldQtd = 0;
16011
+ else
16012
+ maxFieldQtd = Math.floor((containerWidth - mainFieldWidth) / fieldsMinWidth);
16013
+ if (maxFieldQtd && maxFieldQtd < this.fields.length) {
16014
+ maxFieldQtd = Math.floor((containerWidth - mainFieldWidth - expandIconWidth) / fieldsMinWidth);
15897
16015
  }
16016
+ this.maxVisibleFields = maxFieldQtd;
16017
+ if (maxFieldQtd >= this.fields.length && this.expanded)
16018
+ this.collapse();
15898
16019
  };
15899
- SlidePanelComponent.prototype.onContentAnimationStart = function () {
15900
- this.isAnimating = true;
15901
- };
15902
- SlidePanelComponent.prototype.onContentAnimationDone = function () {
15903
- this.isAnimating = false;
15904
- this._calculateSideContentWidth();
16020
+ ObjectCardComponent.prototype.toggle = function () {
16021
+ this.expanded ? this.collapse() : this.expand();
15905
16022
  };
15906
- SlidePanelComponent.prototype._checkOverBehavior = function () {
15907
- this.isSlideOver = window.innerWidth <= SMALL_DEVICE_BREAKPOINT;
16023
+ ObjectCardComponent.prototype.expand = function () {
16024
+ this.expanded = true;
16025
+ this.expandedChange.emit(this.expanded);
15908
16026
  };
15909
- SlidePanelComponent.prototype._calculateSlideHeight = function () {
15910
- this.slideHeight = this._sideContentRef.nativeElement.clientHeight;
16027
+ ObjectCardComponent.prototype.collapse = function () {
16028
+ this.expanded = false;
16029
+ this.expandedChange.emit(this.expanded);
15911
16030
  };
15912
- SlidePanelComponent.prototype._calculateSideContentWidth = function () {
15913
- var slidePanelWidth = this._slidePanelRef.nativeElement.getBoundingClientRect().width;
15914
- var slideContentWidth = this._slideContentRef.nativeElement.getBoundingClientRect().width;
15915
- this.sideContentWidth = slidePanelWidth - slideContentWidth;
16031
+ ObjectCardComponent.prototype.getExpandedFieldWidth = function () {
16032
+ var containerWidth = this.elementRef.nativeElement.offsetWidth;
16033
+ var fieldsPerRow;
16034
+ if (containerWidth <= Breakpoints.SM_MAX)
16035
+ fieldsPerRow = 1;
16036
+ else if (containerWidth <= Breakpoints.MD_MAX)
16037
+ fieldsPerRow = 2;
16038
+ else if (containerWidth <= Breakpoints.LG_MAX)
16039
+ fieldsPerRow = 4;
16040
+ else
16041
+ fieldsPerRow = 6;
16042
+ return 12 / fieldsPerRow;
15916
16043
  };
15917
- var SlidePanelComponent_1;
15918
- SlidePanelComponent.nextId = 0;
15919
- SlidePanelComponent.ctorParameters = function () { return [
15920
- { type: SlidePanelService }
16044
+ var ObjectCardComponent_1;
16045
+ ObjectCardComponent.nextId = 0;
16046
+ ObjectCardComponent.ctorParameters = function () { return [
16047
+ { type: core.ChangeDetectorRef },
16048
+ { type: core.ElementRef }
15921
16049
  ]; };
15922
16050
  __decorate([
15923
16051
  core.Input()
15924
- ], SlidePanelComponent.prototype, "id", void 0);
16052
+ ], ObjectCardComponent.prototype, "id", void 0);
15925
16053
  __decorate([
15926
16054
  core.Input()
15927
- ], SlidePanelComponent.prototype, "openIcon", void 0);
16055
+ ], ObjectCardComponent.prototype, "expanded", void 0);
15928
16056
  __decorate([
15929
16057
  core.Input()
15930
- ], SlidePanelComponent.prototype, "closeIcon", void 0);
16058
+ ], ObjectCardComponent.prototype, "expandTooltip", void 0);
15931
16059
  __decorate([
15932
16060
  core.Input()
15933
- ], SlidePanelComponent.prototype, "cache", void 0);
16061
+ ], ObjectCardComponent.prototype, "collapseTooltip", void 0);
15934
16062
  __decorate([
15935
16063
  core.Input()
15936
- ], SlidePanelComponent.prototype, "createOpen", void 0);
15937
- __decorate([
15938
- core.Output()
15939
- ], SlidePanelComponent.prototype, "panelOpened", void 0);
16064
+ ], ObjectCardComponent.prototype, "fieldsMinWidth", void 0);
15940
16065
  __decorate([
15941
16066
  core.Output()
15942
- ], SlidePanelComponent.prototype, "panelClosed", void 0);
16067
+ ], ObjectCardComponent.prototype, "expandedChange", void 0);
15943
16068
  __decorate([
15944
- core.ViewChild("slidePanel")
15945
- ], SlidePanelComponent.prototype, "_slidePanelRef", void 0);
16069
+ core.ContentChild(ObjectCardMainComponent, { static: true })
16070
+ ], ObjectCardComponent.prototype, "main", void 0);
15946
16071
  __decorate([
15947
- core.ViewChild("slideContent")
15948
- ], SlidePanelComponent.prototype, "_slideContentRef", void 0);
16072
+ core.ContentChildren(ObjectCardFieldComponent, { descendants: true })
16073
+ ], ObjectCardComponent.prototype, "fields", void 0);
15949
16074
  __decorate([
15950
- core.ViewChild("sideContent")
15951
- ], SlidePanelComponent.prototype, "_sideContentRef", void 0);
16075
+ core.Input()
16076
+ ], ObjectCardComponent.prototype, "severity", void 0);
15952
16077
  __decorate([
15953
- core.HostListener("window:resize")
15954
- ], SlidePanelComponent.prototype, "onResize", null);
15955
- SlidePanelComponent = SlidePanelComponent_1 = __decorate([
16078
+ core.Input()
16079
+ ], ObjectCardComponent.prototype, "borderButtonOptions", void 0);
16080
+ ObjectCardComponent = ObjectCardComponent_1 = __decorate([
15956
16081
  core.Component({
15957
- selector: "s-slide-panel",
15958
- 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>",
16082
+ selector: "s-object-card",
16083
+ 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",
15959
16084
  animations: [
15960
- animations.trigger("cachelessAnimation", [
16085
+ animations.trigger("expandableContent", [
16086
+ animations.state("*", animations.style({
16087
+ height: "0",
16088
+ })),
16089
+ animations.state("false", animations.style({
16090
+ height: "0",
16091
+ })),
16092
+ animations.state("true", animations.style({
16093
+ height: "*",
16094
+ })),
16095
+ animations.transition("* => true", animations.animate("200ms ease-out")),
16096
+ animations.transition("false <=> true", animations.animate("200ms ease-out")),
16097
+ ]),
16098
+ animations.trigger("BorderButtonAnimation", [
15961
16099
  animations.transition(":enter", [
15962
- animations.style({ width: "0" }),
15963
- animations.animate("200ms linear", animations.style({ width: "*" })),
16100
+ animations.style({ transform: "scaleY(0)", opacity: 0 }),
16101
+ animations.animate("300ms ease", animations.style({ transform: "scaleY(1)", opacity: 1 })),
15964
16102
  ]),
15965
16103
  animations.transition(":leave", [
15966
- animations.style({ width: "*" }),
15967
- animations.animate("200ms linear", animations.style({ width: "0" })),
16104
+ animations.style({ transform: "scaleY(1)", opacity: 1 }),
16105
+ animations.animate("300ms ease", animations.style({ transform: "scaleY(0)", opacity: 0 })),
15968
16106
  ]),
15969
16107
  ]),
15970
- animations.trigger("cacheAnimation", [
15971
- animations.state("true", animations.style({ width: "*", padding: '0 16px' })),
15972
- animations.state("false", animations.style({ width: '0px', padding: '0' })),
15973
- animations.transition("* => *", animations.animate("200ms")),
15974
- ]),
15975
16108
  ],
15976
- 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}"]
16109
+ 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)}}"]
15977
16110
  })
15978
- ], SlidePanelComponent);
15979
- return SlidePanelComponent;
16111
+ ], ObjectCardComponent);
16112
+ return ObjectCardComponent;
15980
16113
  }());
15981
16114
 
15982
- var SlidePanelModule = /** @class */ (function () {
15983
- function SlidePanelModule() {
16115
+ var BorderButtonComponent = /** @class */ (function () {
16116
+ function BorderButtonComponent() {
16117
+ this.severity = exports.EnumSeverity.Default;
16118
+ this.EnumSeverity = exports.EnumSeverity;
16119
+ this.TooltipPosition = exports.TooltipPosition;
15984
16120
  }
15985
- SlidePanelModule = __decorate([
15986
- core.NgModule({
15987
- imports: [common.CommonModule],
15988
- declarations: [SlidePanelComponent],
15989
- exports: [SlidePanelComponent],
15990
- providers: [SlidePanelService],
16121
+ __decorate([
16122
+ core.Input()
16123
+ ], BorderButtonComponent.prototype, "severity", void 0);
16124
+ __decorate([
16125
+ core.Input()
16126
+ ], BorderButtonComponent.prototype, "options", void 0);
16127
+ BorderButtonComponent = __decorate([
16128
+ core.Component({
16129
+ selector: "s-border-button",
16130
+ 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>",
16131
+ 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}"]
15991
16132
  })
15992
- ], SlidePanelModule);
15993
- return SlidePanelModule;
16133
+ ], BorderButtonComponent);
16134
+ return BorderButtonComponent;
15994
16135
  }());
15995
16136
 
16137
+ var BorderButtonModule = /** @class */ (function () {
16138
+ function BorderButtonModule() {
16139
+ }
16140
+ BorderButtonModule = __decorate([
16141
+ core.NgModule({
16142
+ imports: [common.CommonModule, TooltipModule],
16143
+ declarations: [BorderButtonComponent],
16144
+ exports: [BorderButtonComponent]
16145
+ })
16146
+ ], BorderButtonModule);
16147
+ return BorderButtonModule;
16148
+ }());
15996
16149
 
15997
- (function (SplitButtonType) {
15998
- SplitButtonType["Primary"] = "primary";
15999
- SplitButtonType["Secondary"] = "secondary";
16000
- SplitButtonType["Default"] = "default";
16001
- })(exports.SplitButtonType || (exports.SplitButtonType = {}));
16150
+ var ObjectCardModule = /** @class */ (function () {
16151
+ function ObjectCardModule() {
16152
+ }
16153
+ ObjectCardModule = __decorate([
16154
+ core.NgModule({
16155
+ imports: [common.CommonModule, tooltip.TooltipModule, ThumbnailModule, ButtonModule, BorderButtonModule],
16156
+ declarations: [ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
16157
+ exports: [ThumbnailModule, ObjectCardComponent, ObjectCardMainComponent, ObjectCardFieldComponent],
16158
+ })
16159
+ ], ObjectCardModule);
16160
+ return ObjectCardModule;
16161
+ }());
16002
16162
 
16003
- var SplitButtonComponent = /** @class */ (function () {
16004
- function SplitButtonComponent(eRef) {
16005
- this.eRef = eRef;
16006
- this.disabled = false;
16007
- this.type = exports.SplitButtonType.Primary;
16008
- this.buttonClicked = new core.EventEmitter();
16009
- this.open = false;
16163
+ var ProductHeaderComponent = /** @class */ (function () {
16164
+ function ProductHeaderComponent() {
16165
+ this.id = "s-product-header-" + ProductHeaderComponent_1.nextId++;
16166
+ this.baseZIndex = 0;
16167
+ this.isHeaderFrame = true;
16010
16168
  }
16011
- SplitButtonComponent.prototype.onClickout = function (event) {
16012
- if (!this.eRef.nativeElement.contains(event.target)) {
16013
- this.closeDropdown();
16014
- }
16015
- };
16016
- SplitButtonComponent.prototype.onButtonClick = function () {
16017
- if (!this.disabled) {
16018
- this.buttonClicked.emit();
16019
- this.closeDropdown();
16169
+ ProductHeaderComponent_1 = ProductHeaderComponent;
16170
+ ProductHeaderComponent.prototype.ngAfterViewInit = function () {
16171
+ this.container.nativeElement.style.zIndex = String(this.baseZIndex + ++dom.DomHandler.zindex);
16172
+ if (this.isHeaderFrame) {
16173
+ this.container.nativeElement.style.borderBottom = "1px solid $default-secondary-color";
16020
16174
  }
16021
- };
16022
- SplitButtonComponent.prototype.onDropdownClick = function () {
16023
- if (!this.disabled) {
16024
- this.open = !this.open;
16175
+ else {
16176
+ this.container.nativeElement.style.borderTop = "1px solid $default-secondary-color";
16025
16177
  }
16026
16178
  };
16027
- SplitButtonComponent.prototype.onOptionClick = function (option) {
16028
- option.action && option.action();
16029
- this.closeDropdown();
16030
- };
16031
- SplitButtonComponent.prototype.closeDropdown = function () {
16032
- this.open = false;
16033
- };
16034
- SplitButtonComponent.ctorParameters = function () { return [
16035
- { type: core.ElementRef }
16036
- ]; };
16037
- __decorate([
16038
- core.Input()
16039
- ], SplitButtonComponent.prototype, "disabled", void 0);
16179
+ var ProductHeaderComponent_1;
16180
+ ProductHeaderComponent.nextId = 0;
16040
16181
  __decorate([
16041
16182
  core.Input()
16042
- ], SplitButtonComponent.prototype, "iconClass", void 0);
16183
+ ], ProductHeaderComponent.prototype, "id", void 0);
16043
16184
  __decorate([
16044
16185
  core.Input()
16045
- ], SplitButtonComponent.prototype, "label", void 0);
16186
+ ], ProductHeaderComponent.prototype, "header", void 0);
16046
16187
  __decorate([
16047
16188
  core.Input()
16048
- ], SplitButtonComponent.prototype, "type", void 0);
16189
+ ], ProductHeaderComponent.prototype, "baseZIndex", void 0);
16049
16190
  __decorate([
16050
16191
  core.Input()
16051
- ], SplitButtonComponent.prototype, "options", void 0);
16052
- __decorate([
16053
- core.Output()
16054
- ], SplitButtonComponent.prototype, "buttonClicked", void 0);
16192
+ ], ProductHeaderComponent.prototype, "isHeaderFrame", void 0);
16055
16193
  __decorate([
16056
- core.HostListener("document:click", ["$event"])
16057
- ], SplitButtonComponent.prototype, "onClickout", null);
16058
- SplitButtonComponent = __decorate([
16194
+ core.ViewChild("headerContainer", { static: false })
16195
+ ], ProductHeaderComponent.prototype, "container", void 0);
16196
+ ProductHeaderComponent = ProductHeaderComponent_1 = __decorate([
16059
16197
  core.Component({
16060
- selector: "s-split-button",
16061
- 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>",
16062
- 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}"]
16063
- })
16064
- ], SplitButtonComponent);
16065
- return SplitButtonComponent;
16066
- }());
16067
-
16068
- var SplitButtonModule = /** @class */ (function () {
16069
- function SplitButtonModule() {
16070
- }
16071
- SplitButtonModule = __decorate([
16072
- core.NgModule({
16073
- imports: [common.CommonModule],
16074
- declarations: [SplitButtonComponent],
16075
- exports: [SplitButtonComponent],
16198
+ selector: "s-product-header",
16199
+ 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",
16200
+ 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}"]
16076
16201
  })
16077
- ], SplitButtonModule);
16078
- return SplitButtonModule;
16202
+ ], ProductHeaderComponent);
16203
+ return ProductHeaderComponent;
16079
16204
  }());
16080
-
16081
- var StatsCardComponent = /** @class */ (function () {
16082
- function StatsCardComponent() {
16083
- this.id = "s-stats-card-" + StatsCardComponent_1.nextId++;
16084
- this.alwaysWithBorder = false;
16085
- this.lightVersion = false;
16086
- this.lightMode = true;
16087
- this.iconClass = "fa fa-bar-chart";
16088
- this.color = "#339966";
16089
- this.animateNumbers = true;
16090
- this.clickable = false;
16091
- this.tooltip = "";
16092
- this.onClick = new core.EventEmitter();
16093
- this.ANIMATION_DURATION_MS = 200;
16094
- this.STEP_DURATION_MS = 20;
16095
- this.previousValue = "0";
16096
- this._value = "0";
16097
- }
16098
- StatsCardComponent_1 = StatsCardComponent;
16099
- Object.defineProperty(StatsCardComponent.prototype, "value", {
16100
- get: function () {
16101
- return this._value;
16102
- },
16103
- set: function (value) {
16104
- this.previousValue = this._value;
16105
- this._value = String(value);
16106
- if (this.animateNumbers)
16107
- this.updateDisplayValue();
16108
- else
16109
- this.displayValue = this.value;
16110
- },
16111
- enumerable: true,
16112
- configurable: true
16113
- });
16114
- StatsCardComponent.prototype.updateDisplayValue = function () {
16115
- var _this = this;
16116
- var animationDuration = new BigNumber.BigNumber(this.ANIMATION_DURATION_MS);
16117
- var stepDuration = new BigNumber.BigNumber(this.STEP_DURATION_MS);
16118
- var animationCount = animationDuration.dividedBy(stepDuration);
16119
- var previousRawValue = new BigNumber.BigNumber(this.previousValue.replace(/\D/g, ""));
16120
- var rawValue = new BigNumber.BigNumber(this.value.replace(/\D/g, ""));
16121
- var incrementValue = rawValue.minus(previousRawValue).absoluteValue().dividedBy(animationCount);
16122
- var incremental = previousRawValue.isLessThan(rawValue);
16123
- clearInterval(this.intervalId);
16124
- this.displayValue = this.replaceNumericPositions(this.value);
16125
- var counter = previousRawValue;
16126
- this.intervalId = setInterval(function () {
16127
- if (incremental && counter.isLessThan(rawValue)) {
16128
- _this.displayValue = _this.replaceNumericPositions(_this.displayValue, counter);
16129
- counter = counter.plus(incrementValue);
16130
- }
16131
- else if (!incremental && counter.isGreaterThan(rawValue)) {
16132
- _this.displayValue = _this.replaceNumericPositions(_this.displayValue, counter);
16133
- counter = counter.minus(incrementValue);
16134
- }
16135
- else {
16136
- _this.displayValue = _this.value;
16137
- clearInterval(_this.intervalId);
16138
- }
16139
- }, this.STEP_DURATION_MS);
16140
- };
16141
- StatsCardComponent.prototype.replaceNumericPositions = function (value, newValue) {
16142
- var rawValue = value.replace(/[^\d]/g, "");
16143
- var newValueString = newValue ? newValue.toString() : "";
16144
- var formattedNewValue = newValueString
16145
- .toString()
16146
- .replace(/\D/g, "")
16147
- .padStart(rawValue.length, "0");
16148
- var newValueIndex = 0;
16149
- return value
16150
- .split("")
16151
- .map(function (char) {
16152
- var number = Number(char);
16153
- if (number || char === "0")
16154
- return formattedNewValue[newValueIndex++];
16155
- return char;
16205
+
16206
+ var ProductHeaderModule = /** @class */ (function () {
16207
+ function ProductHeaderModule() {
16208
+ }
16209
+ ProductHeaderModule = __decorate([
16210
+ core.NgModule({
16211
+ imports: [common.CommonModule, tooltip.TooltipModule, ThumbnailModule],
16212
+ declarations: [ProductHeaderComponent],
16213
+ exports: [ProductHeaderComponent, ThumbnailModule],
16156
16214
  })
16157
- .join("");
16215
+ ], ProductHeaderModule);
16216
+ return ProductHeaderModule;
16217
+ }());
16218
+
16219
+
16220
+ (function (ProgressBarColors) {
16221
+ ProgressBarColors["Blue"] = "blue";
16222
+ ProgressBarColors["Green"] = "green";
16223
+ ProgressBarColors["Red"] = "red";
16224
+ ProgressBarColors["Yellow"] = "yellow";
16225
+ })(exports.ProgressBarColors || (exports.ProgressBarColors = {}));
16226
+
16227
+ var ProgressBarMode;
16228
+ (function (ProgressBarMode) {
16229
+ ProgressBarMode["Determinate"] = "determinate";
16230
+ ProgressBarMode["Indeterminate"] = "indeterminate";
16231
+ })(ProgressBarMode || (ProgressBarMode = {}));
16232
+
16233
+ var ProgressBarComponent = /** @class */ (function () {
16234
+ function ProgressBarComponent() {
16235
+ this.numberFormatOptions = {
16236
+ style: "decimal",
16237
+ minimumFractionDigits: 0,
16238
+ maximumFractionDigits: 2,
16239
+ };
16240
+ this.showValue = true;
16241
+ this.mode = ProgressBarMode.Determinate;
16242
+ }
16243
+ ProgressBarComponent.prototype.ngOnInit = function () {
16244
+ this.validateInputs();
16245
+ };
16246
+ ProgressBarComponent.prototype.validateInputs = function () {
16247
+ if (this.value < 0 || this.value > 100) {
16248
+ throw new Error("Invalid value for value");
16249
+ }
16250
+ if (this.targetValue < 0 || this.targetValue > 100) {
16251
+ throw new Error("Invalid value for targetValue");
16252
+ }
16253
+ if (this.mode === ProgressBarMode.Indeterminate && (this.value || this.targetValue || this.targetLabel)) {
16254
+ throw new Error("When the mode is indeterminate, the value, targetValue and targetLabel parameters are not expected.");
16255
+ }
16158
16256
  };
16159
- var StatsCardComponent_1;
16160
- StatsCardComponent.nextId = 0;
16161
16257
  __decorate([
16162
16258
  core.Input()
16163
- ], StatsCardComponent.prototype, "id", void 0);
16259
+ ], ProgressBarComponent.prototype, "value", void 0);
16164
16260
  __decorate([
16165
16261
  core.Input()
16166
- ], StatsCardComponent.prototype, "label", void 0);
16262
+ ], ProgressBarComponent.prototype, "numberFormatOptions", void 0);
16167
16263
  __decorate([
16168
16264
  core.Input()
16169
- ], StatsCardComponent.prototype, "alwaysWithBorder", void 0);
16265
+ ], ProgressBarComponent.prototype, "targetValue", void 0);
16170
16266
  __decorate([
16171
16267
  core.Input()
16172
- ], StatsCardComponent.prototype, "lightVersion", void 0);
16268
+ ], ProgressBarComponent.prototype, "label", void 0);
16173
16269
  __decorate([
16174
16270
  core.Input()
16175
- ], StatsCardComponent.prototype, "lightMode", void 0);
16271
+ ], ProgressBarComponent.prototype, "targetLabel", void 0);
16176
16272
  __decorate([
16177
16273
  core.Input()
16178
- ], StatsCardComponent.prototype, "iconClass", void 0);
16274
+ ], ProgressBarComponent.prototype, "activeColor", void 0);
16179
16275
  __decorate([
16180
16276
  core.Input()
16181
- ], StatsCardComponent.prototype, "color", void 0);
16277
+ ], ProgressBarComponent.prototype, "showValue", void 0);
16182
16278
  __decorate([
16183
16279
  core.Input()
16184
- ], StatsCardComponent.prototype, "animateNumbers", void 0);
16280
+ ], ProgressBarComponent.prototype, "mode", void 0);
16281
+ ProgressBarComponent = __decorate([
16282
+ core.Component({
16283
+ selector: "s-progressbar",
16284
+ 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>",
16285
+ 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}"]
16286
+ })
16287
+ ], ProgressBarComponent);
16288
+ return ProgressBarComponent;
16289
+ }());
16290
+
16291
+ var ProgressBarDeterminateComponent = /** @class */ (function () {
16292
+ function ProgressBarDeterminateComponent(localeService) {
16293
+ this.localeService = localeService;
16294
+ this.showValue = true;
16295
+ }
16296
+ ProgressBarDeterminateComponent.prototype.ngOnInit = function () {
16297
+ this.validateValues();
16298
+ this.onGetLocale();
16299
+ };
16300
+ ProgressBarDeterminateComponent.prototype.onGetLocale = function () {
16301
+ var _this = this;
16302
+ this.localeService.getLocale().subscribe({
16303
+ next: function (locale) {
16304
+ _this.numberFormat = new Intl.NumberFormat(locale !== null && locale !== void 0 ? locale : "pt-BR", _this.numberFormatOptions);
16305
+ },
16306
+ error: function () {
16307
+ _this.numberFormat = new Intl.NumberFormat("pt-BR", _this.numberFormatOptions);
16308
+ },
16309
+ });
16310
+ };
16311
+ ProgressBarDeterminateComponent.prototype.validateValues = function () {
16312
+ if (this.value < 0 || this.value > 100) {
16313
+ throw new Error("Invalid value for value");
16314
+ }
16315
+ if (this.targetValue < 0 || this.targetValue > 100) {
16316
+ throw new Error("Invalid value for targetValue");
16317
+ }
16318
+ };
16319
+ ProgressBarDeterminateComponent.ctorParameters = function () { return [
16320
+ { type: LocaleService }
16321
+ ]; };
16185
16322
  __decorate([
16186
16323
  core.Input()
16187
- ], StatsCardComponent.prototype, "clickable", void 0);
16324
+ ], ProgressBarDeterminateComponent.prototype, "value", void 0);
16188
16325
  __decorate([
16189
16326
  core.Input()
16190
- ], StatsCardComponent.prototype, "value", null);
16327
+ ], ProgressBarDeterminateComponent.prototype, "numberFormatOptions", void 0);
16191
16328
  __decorate([
16192
16329
  core.Input()
16193
- ], StatsCardComponent.prototype, "tooltip", void 0);
16330
+ ], ProgressBarDeterminateComponent.prototype, "targetValue", void 0);
16194
16331
  __decorate([
16195
- core.Output()
16196
- ], StatsCardComponent.prototype, "onClick", void 0);
16197
- StatsCardComponent = StatsCardComponent_1 = __decorate([
16332
+ core.Input()
16333
+ ], ProgressBarDeterminateComponent.prototype, "targetLabel", void 0);
16334
+ __decorate([
16335
+ core.Input()
16336
+ ], ProgressBarDeterminateComponent.prototype, "activeColor", void 0);
16337
+ __decorate([
16338
+ core.Input()
16339
+ ], ProgressBarDeterminateComponent.prototype, "showValue", void 0);
16340
+ ProgressBarDeterminateComponent = __decorate([
16198
16341
  core.Component({
16199
- selector: "s-stats-card",
16200
- 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",
16201
- encapsulation: core.ViewEncapsulation.None,
16202
- 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}}"]
16342
+ selector: "s-progressbar-determinate",
16343
+ 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",
16344
+ 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}"]
16203
16345
  })
16204
- ], StatsCardComponent);
16205
- return StatsCardComponent;
16346
+ ], ProgressBarDeterminateComponent);
16347
+ return ProgressBarDeterminateComponent;
16206
16348
  }());
16207
16349
 
16208
- var StatsCardModule = /** @class */ (function () {
16209
- function StatsCardModule() {
16350
+ var ProgressBarIndeterminateComponent = /** @class */ (function () {
16351
+ function ProgressBarIndeterminateComponent() {
16210
16352
  }
16211
- StatsCardModule = __decorate([
16353
+ __decorate([
16354
+ core.Input()
16355
+ ], ProgressBarIndeterminateComponent.prototype, "activeColor", void 0);
16356
+ __decorate([
16357
+ core.Input()
16358
+ ], ProgressBarIndeterminateComponent.prototype, "label", void 0);
16359
+ ProgressBarIndeterminateComponent = __decorate([
16360
+ core.Component({
16361
+ selector: "s-progressbar-indeterminate",
16362
+ 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",
16363
+ 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%)}}"]
16364
+ })
16365
+ ], ProgressBarIndeterminateComponent);
16366
+ return ProgressBarIndeterminateComponent;
16367
+ }());
16368
+
16369
+ var ProgressBarModule = /** @class */ (function () {
16370
+ function ProgressBarModule() {
16371
+ }
16372
+ ProgressBarModule = __decorate([
16212
16373
  core.NgModule({
16213
- imports: [
16214
- common.CommonModule,
16215
- tooltip.TooltipModule,
16216
- ],
16374
+ imports: [common.CommonModule],
16217
16375
  declarations: [
16218
- StatsCardComponent,
16219
- ],
16220
- exports: [
16221
- StatsCardComponent,
16376
+ ProgressBarComponent,
16377
+ ProgressBarDeterminateComponent,
16378
+ ProgressBarIndeterminateComponent,
16222
16379
  ],
16380
+ exports: [ProgressBarComponent],
16223
16381
  })
16224
- ], StatsCardModule);
16225
- return StatsCardModule;
16382
+ ], ProgressBarModule);
16383
+ return ProgressBarModule;
16226
16384
  }());
16227
16385
 
16228
-
16229
- (function (StepState) {
16230
- StepState["Default"] = "default";
16231
- StepState["Success"] = "success";
16232
- StepState["Warning"] = "warning";
16233
- })(exports.StepState || (exports.StepState = {}));
16234
- var StepsComponent = /** @class */ (function () {
16235
- function StepsComponent() {
16236
- this.id = "s-steps-" + StepsComponent_1.nextId++;
16237
- this.activeIndex = 0;
16238
- this.stepSelected = new core.EventEmitter();
16386
+ var PanelComponent = /** @class */ (function () {
16387
+ function PanelComponent() {
16388
+ this.toggleable = true;
16389
+ this.collapsed = false;
16390
+ this.severity = exports.EnumSeverity.Default;
16391
+ this.collapsedChange = new core.EventEmitter();
16392
+ this.EnumSeverity = exports.EnumSeverity;
16239
16393
  }
16240
- StepsComponent_1 = StepsComponent;
16241
- StepsComponent.prototype.stepClick = function (step, index, event) {
16242
- if (step.disabled || index == this.activeIndex)
16243
- return;
16244
- this.stepSelected.emit({ step: step, index: index, event: event });
16245
- };
16246
- Object.defineProperty(StepsComponent.prototype, "stepState", {
16247
- get: function () {
16248
- return exports.StepState;
16249
- },
16250
- enumerable: true,
16251
- configurable: true
16252
- });
16253
- StepsComponent.prototype.barAnimation = function (index, activeIndex) {
16254
- var visited = index < activeIndex;
16255
- var activated = index === activeIndex;
16256
- return visited || activated;
16257
- };
16258
- StepsComponent.prototype.afterBarAnimation = function (index, activeIndex) {
16259
- var visited = index < activeIndex;
16260
- var activated = index === activeIndex - 1;
16261
- return visited || activated;
16394
+ PanelComponent.prototype.onCollapsedChange = function (collapsed) {
16395
+ this.collapsed = collapsed;
16396
+ this.collapsedChange.emit(this.collapsed);
16262
16397
  };
16263
- Object.defineProperty(StepsComponent.prototype, "visibledStep", {
16264
- get: function () {
16265
- return this.steps.filter(function (step) { return !step.hidden; });
16266
- },
16267
- enumerable: true,
16268
- configurable: true
16269
- });
16270
- var StepsComponent_1;
16271
- StepsComponent.nextId = 0;
16272
16398
  __decorate([
16273
16399
  core.Input()
16274
- ], StepsComponent.prototype, "id", void 0);
16400
+ ], PanelComponent.prototype, "header", void 0);
16275
16401
  __decorate([
16276
16402
  core.Input()
16277
- ], StepsComponent.prototype, "steps", void 0);
16403
+ ], PanelComponent.prototype, "toggleable", void 0);
16278
16404
  __decorate([
16279
16405
  core.Input()
16280
- ], StepsComponent.prototype, "activeIndex", void 0);
16406
+ ], PanelComponent.prototype, "collapsed", void 0);
16407
+ __decorate([
16408
+ core.Input()
16409
+ ], PanelComponent.prototype, "severity", void 0);
16410
+ __decorate([
16411
+ core.Input()
16412
+ ], PanelComponent.prototype, "borderButtonOptions", void 0);
16281
16413
  __decorate([
16282
16414
  core.Output()
16283
- ], StepsComponent.prototype, "stepSelected", void 0);
16284
- StepsComponent = StepsComponent_1 = __decorate([
16415
+ ], PanelComponent.prototype, "collapsedChange", void 0);
16416
+ PanelComponent = __decorate([
16285
16417
  core.Component({
16286
- selector: "s-steps",
16287
- 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",
16288
- host: {
16289
- "aria-orientation": "horizontal",
16290
- role: "tablist",
16291
- "tab-index": "0",
16292
- },
16418
+ selector: "s-panel",
16419
+ 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>",
16293
16420
  animations: [
16294
- animations.trigger("beforeActiveDesative", [
16295
- animations.state("active", animations.style({
16296
- "background-position": "left bottom",
16297
- })),
16298
- animations.state("desactive", animations.style({
16299
- "background-position": "right bottom",
16300
- })),
16301
- animations.transition("active => desactive", [animations.animate("50ms 100ms linear")]),
16302
- animations.transition("desactive => active", [animations.animate("50ms 250ms linear")]),
16303
- ]),
16304
- animations.trigger("activeDesative", [
16305
- animations.state("active", animations.style({
16306
- "background-position": "left bottom",
16307
- })),
16308
- animations.state("desactive", animations.style({
16309
- "background-position": "right bottom",
16310
- })),
16311
- animations.transition("active => desactive", [animations.animate("100ms 150ms linear")]),
16312
- animations.transition("desactive => active", [animations.animate("100ms 150ms linear")]),
16313
- ]),
16314
- animations.trigger("afterActiveDesative", [
16315
- animations.state("active", animations.style({
16316
- "background-position": "left bottom",
16317
- })),
16318
- animations.state("desactive", animations.style({
16319
- "background-position": "right bottom",
16320
- })),
16321
- animations.transition("active => desactive", [animations.animate("50ms 250ms linear")]),
16322
- animations.transition("desactive => active", [animations.animate("50ms 100ms linear")]),
16421
+ animations.trigger("BorderButtonAnimation", [
16422
+ animations.transition(":enter", [
16423
+ animations.style({ transform: "scaleY(0)", opacity: 0 }),
16424
+ animations.animate("300ms ease", animations.style({ transform: "scaleY(1)", opacity: 1 })),
16425
+ ]),
16426
+ animations.transition(":leave", [
16427
+ animations.style({ transform: "scaleY(1)", opacity: 1 }),
16428
+ animations.animate("300ms ease", animations.style({ transform: "scaleY(0)", opacity: 0 })),
16429
+ ]),
16323
16430
  ]),
16324
16431
  ],
16325
- 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}}"]
16432
+ 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}"]
16326
16433
  })
16327
- ], StepsComponent);
16328
- return StepsComponent;
16434
+ ], PanelComponent);
16435
+ return PanelComponent;
16329
16436
  }());
16330
16437
 
16331
- var StepsModule = /** @class */ (function () {
16332
- function StepsModule() {
16438
+ var PanelModule = /** @class */ (function () {
16439
+ function PanelModule() {
16333
16440
  }
16334
- StepsModule = __decorate([
16441
+ PanelModule = __decorate([
16335
16442
  core.NgModule({
16336
- imports: [common.CommonModule, tooltip.TooltipModule],
16337
- declarations: [StepsComponent],
16338
- exports: [StepsComponent],
16443
+ imports: [common.CommonModule, panel.PanelModule, BorderButtonModule],
16444
+ declarations: [PanelComponent],
16445
+ exports: [PanelComponent],
16339
16446
  })
16340
- ], StepsModule);
16341
- return StepsModule;
16342
- }());
16343
-
16344
- var TieredMenuEventService = /** @class */ (function () {
16345
- function TieredMenuEventService() {
16346
- this.incrementCurrentItemEvent = new core.EventEmitter();
16347
- this.decrementCurrentItemEvent = new core.EventEmitter();
16348
- this.closeAllMenusEvent = new core.EventEmitter();
16349
- this.selectItemEvent = new core.EventEmitter();
16350
- this.openItemMenuEvent = new core.EventEmitter();
16351
- this.closeItemMenuEvent = new core.EventEmitter();
16352
- this.createMenuEvent = new core.EventEmitter();
16353
- }
16354
- TieredMenuEventService = __decorate([
16355
- core.Injectable()
16356
- ], TieredMenuEventService);
16357
- return TieredMenuEventService;
16447
+ ], PanelModule);
16448
+ return PanelModule;
16358
16449
  }());
16359
16450
 
16360
- var TieredMenuService = /** @class */ (function () {
16361
- function TieredMenuService() {
16362
- this.currentItems = [];
16363
- this.items = [];
16451
+ var RatingScaleComponent = /** @class */ (function () {
16452
+ function RatingScaleComponent() {
16453
+ this.disabled = false;
16364
16454
  }
16365
- TieredMenuService.prototype.normalizeData = function (items, parent) {
16366
- var _this = this;
16367
- return items.map(function (i) {
16368
- var item = __assign({ visible: true }, i);
16369
- if (item.submenu) {
16370
- item.submenu = _this.normalizeData(item.submenu, item);
16371
- }
16372
- item.id = _this._generateId();
16373
- item.parent = parent;
16374
- item.isOpen = false;
16375
- return item;
16376
- });
16377
- };
16378
- TieredMenuService.prototype.markAllItemsAsClosed = function (items) {
16379
- var _this = this;
16380
- return items.map(function (i) {
16381
- var item = __assign({}, i);
16382
- if (item.submenu) {
16383
- item.submenu = _this.markAllItemsAsClosed(item.submenu);
16384
- }
16385
- item.isOpen = false;
16386
- return item;
16387
- });
16388
- };
16389
- TieredMenuService.prototype.searchTheHierarchy = function (itemA, itemB) {
16390
- var item = itemB;
16391
- while (item) {
16392
- if (item === itemA) {
16393
- return true;
16394
- }
16395
- item = item.parent;
16455
+ RatingScaleComponent_1 = RatingScaleComponent;
16456
+ RatingScaleComponent.prototype.writeValue = function (value) {
16457
+ if (!this.disabled) {
16458
+ this.value = value;
16396
16459
  }
16397
- return false;
16398
16460
  };
16399
- TieredMenuService.prototype.cloneItems = function (items) {
16400
- return JSON.parse(JSON.stringify(items));
16461
+ RatingScaleComponent.prototype.registerOnChange = function (onChange) {
16462
+ this._onChange = onChange;
16401
16463
  };
16402
- TieredMenuService.prototype._generateId = function () {
16403
- return "id-" + Math.random().toString(36).substring(2, 9) + "-" + Math.random().toString(36).substring(2, 9) + "-" + Math.random().toString(36).substring(2, 9);
16464
+ RatingScaleComponent.prototype.registerOnTouched = function (onTouched) {
16465
+ this._onTouched = onTouched;
16404
16466
  };
16405
- TieredMenuService = __decorate([
16406
- core.Injectable()
16407
- ], TieredMenuService);
16408
- return TieredMenuService;
16467
+ RatingScaleComponent.prototype.onSelect = function (rating) {
16468
+ this.value = rating;
16469
+ if (this._onChange) {
16470
+ this._onChange(this.value);
16471
+ }
16472
+ };
16473
+ var RatingScaleComponent_1;
16474
+ __decorate([
16475
+ core.Input()
16476
+ ], RatingScaleComponent.prototype, "nodes", void 0);
16477
+ __decorate([
16478
+ core.Input()
16479
+ ], RatingScaleComponent.prototype, "startLabel", void 0);
16480
+ __decorate([
16481
+ core.Input()
16482
+ ], RatingScaleComponent.prototype, "endLabel", void 0);
16483
+ __decorate([
16484
+ core.Input()
16485
+ ], RatingScaleComponent.prototype, "disabled", void 0);
16486
+ RatingScaleComponent = RatingScaleComponent_1 = __decorate([
16487
+ core.Component({
16488
+ selector: "s-rating-scale",
16489
+ 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>",
16490
+ providers: [{
16491
+ provide: forms.NG_VALUE_ACCESSOR,
16492
+ useExisting: core.forwardRef(function () { return RatingScaleComponent_1; }),
16493
+ multi: true,
16494
+ }],
16495
+ 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}"]
16496
+ })
16497
+ ], RatingScaleComponent);
16498
+ return RatingScaleComponent;
16409
16499
  }());
16410
16500
 
16411
- var TieredMenuNestedComponent = /** @class */ (function () {
16412
- function TieredMenuNestedComponent(tieredMenuService, _tieredMenuEventService) {
16413
- this.tieredMenuService = tieredMenuService;
16414
- this._tieredMenuEventService = _tieredMenuEventService;
16415
- this.top = 0;
16416
- this.left = 0;
16417
- this._unsubscribe$ = new rxjs.Subject();
16501
+ var RatingScaleModule = /** @class */ (function () {
16502
+ function RatingScaleModule() {
16418
16503
  }
16419
- TieredMenuNestedComponent.prototype.onResize = function () {
16420
- this._tieredMenuEventService.closeAllMenusEvent.emit();
16421
- };
16422
- TieredMenuNestedComponent.prototype.onDocumentClick = function (event) {
16423
- // Closing menu when clicked outside.
16424
- var target = event.target;
16425
- var clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
16426
- if (!clickedInside) {
16427
- this._tieredMenuEventService.closeAllMenusEvent.emit();
16428
- }
16429
- };
16430
- TieredMenuNestedComponent.prototype.onKeydownHandler = function (event) {
16431
- switch (event.key) {
16432
- case "Escape":
16433
- this._tieredMenuEventService.closeAllMenusEvent.emit();
16434
- break;
16435
- case " ":
16436
- case "Enter":
16437
- this._tieredMenuEventService.selectItemEvent.emit(this.tieredMenuService.currentItem);
16438
- break;
16439
- case "ArrowLeft":
16440
- // When nested I need a reference to the current item's parent item, otherwise just the current item.
16441
- this._tieredMenuEventService.closeItemMenuEvent.emit(this.tieredMenuService.currentItem.parent);
16442
- break;
16443
- case "ArrowRight":
16444
- this._tieredMenuEventService.openItemMenuEvent.emit(this.tieredMenuService.currentItem);
16445
- break;
16446
- case "ArrowUp":
16447
- this._tieredMenuEventService.decrementCurrentItemEvent.emit();
16448
- break;
16449
- case "ArrowDown":
16450
- this._tieredMenuEventService.incrementCurrentItemEvent.emit();
16451
- break;
16452
- }
16453
- };
16454
- TieredMenuNestedComponent.prototype.ngOnInit = function () {
16455
- this.tieredMenuService.currentItems = this.items;
16456
- this._subscribeEvents();
16457
- };
16458
- TieredMenuNestedComponent.prototype.ngOnDestroy = function () {
16459
- this._unsubscribe$.next();
16460
- this._unsubscribe$.complete();
16461
- };
16462
- TieredMenuNestedComponent.prototype._incrementCurItem = function () {
16463
- if (!this.tieredMenuService.currentItem) {
16464
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
16465
- return;
16466
- }
16467
- var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
16468
- if (curIndex < this.tieredMenuService.currentItems.length) {
16469
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
16470
- }
16471
- else {
16472
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
16473
- }
16474
- if (this.tieredMenuService.currentItem.divider) {
16475
- this._incrementCurItem();
16476
- }
16477
- };
16478
- TieredMenuNestedComponent.prototype._decrementCurItem = function () {
16479
- if (!this.tieredMenuService.currentItem) {
16480
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
16504
+ RatingScaleModule = __decorate([
16505
+ core.NgModule({
16506
+ imports: [
16507
+ common.CommonModule,
16508
+ forms.ReactiveFormsModule,
16509
+ ],
16510
+ declarations: [RatingScaleComponent],
16511
+ exports: [RatingScaleComponent],
16512
+ })
16513
+ ], RatingScaleModule);
16514
+ return RatingScaleModule;
16515
+ }());
16516
+
16517
+ var SelectButtonComponent = /** @class */ (function () {
16518
+ function SelectButtonComponent() {
16519
+ this.multiple = false;
16520
+ this.itemSelected = new core.EventEmitter();
16521
+ this.itemClicked = new core.EventEmitter();
16522
+ this.disabled = false;
16523
+ this.activeItems = new Set();
16524
+ }
16525
+ SelectButtonComponent_1 = SelectButtonComponent;
16526
+ SelectButtonComponent.prototype.writeValue = function (value) {
16527
+ var _this = this;
16528
+ if (!value)
16481
16529
  return;
16482
- }
16483
- var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
16484
- if (curIndex >= 0) {
16485
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
16530
+ this.activeItems.clear();
16531
+ if (Array.isArray(value)) {
16532
+ value.forEach(function (item) {
16533
+ _this.items.forEach(function (iItem) {
16534
+ if (_this._compareItems(item, iItem)) {
16535
+ _this.activeItems.add(iItem);
16536
+ }
16537
+ });
16538
+ });
16486
16539
  }
16487
16540
  else {
16488
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
16489
- }
16490
- if (this.tieredMenuService.currentItem.divider) {
16491
- this._decrementCurItem();
16541
+ this.items.forEach(function (iItem) {
16542
+ if (_this._compareItems(value, iItem)) {
16543
+ _this.activeItems.add(iItem);
16544
+ }
16545
+ });
16492
16546
  }
16493
16547
  };
16494
- TieredMenuNestedComponent.prototype._closeItem = function (item) {
16495
- var _a;
16496
- var itemAux = this._lastOpenItem;
16497
- while (itemAux && itemAux != item) {
16498
- itemAux.isOpen = false;
16499
- itemAux = itemAux.parent;
16500
- }
16501
- item.isOpen = false;
16502
- this.tieredMenuService.currentItem = itemAux !== null && itemAux !== void 0 ? itemAux : this.tieredMenuService.items[0];
16503
- this.tieredMenuService.currentItems = ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.submenu) || this.tieredMenuService.items;
16548
+ SelectButtonComponent.prototype.registerOnChange = function (onChange) {
16549
+ this.onChange = onChange;
16504
16550
  };
16505
- TieredMenuNestedComponent.prototype._openItem = function (item) {
16506
- if (item === null || item === void 0 ? void 0 : item.submenu) {
16507
- item.isOpen = true;
16508
- this.tieredMenuService.currentItems = item.submenu;
16509
- // Only has focus if there has already been interaction.
16510
- if (this.tieredMenuService.currentItem) {
16511
- this.tieredMenuService.currentItem = item.submenu[0];
16512
- }
16513
- this._lastOpenItem = item;
16551
+ SelectButtonComponent.prototype.registerOnTouched = function (onTouched) {
16552
+ this.onTouched = onTouched;
16553
+ };
16554
+ SelectButtonComponent.prototype.setDisabledState = function (disabled) {
16555
+ this.disabled = disabled;
16556
+ };
16557
+ SelectButtonComponent.prototype.onItemSelect = function (item) {
16558
+ var _a, _b;
16559
+ if (this.disabled || item.disabled)
16560
+ return;
16561
+ this.itemClicked.emit(item);
16562
+ if (!this.multiple) {
16563
+ this.activeItems.clear();
16514
16564
  }
16565
+ this.activeItems.add(item);
16566
+ this.itemSelected.emit(__spread(this.activeItems));
16567
+ (_a = this.onChange) === null || _a === void 0 ? void 0 : _a.call(this, __spread(this.activeItems));
16568
+ (_b = this.onTouched) === null || _b === void 0 ? void 0 : _b.call(this, __spread(this.activeItems));
16515
16569
  };
16516
- TieredMenuNestedComponent.prototype._subscribeEvents = function () {
16517
- var _this = this;
16518
- this._tieredMenuEventService.incrementCurrentItemEvent
16519
- .pipe(operators.takeUntil(this._unsubscribe$))
16520
- .subscribe(function () {
16521
- _this._incrementCurItem();
16522
- });
16523
- this._tieredMenuEventService.decrementCurrentItemEvent
16524
- .pipe(operators.takeUntil(this._unsubscribe$))
16525
- .subscribe(function () {
16526
- _this._decrementCurItem();
16527
- });
16528
- this._tieredMenuEventService.selectItemEvent
16529
- .pipe(operators.takeUntil(this._unsubscribe$))
16530
- .subscribe(function (item) {
16531
- if (item.command) {
16532
- item.command();
16533
- // Close all menus after the item was selected.
16534
- _this._tieredMenuEventService.closeAllMenusEvent.emit();
16570
+ SelectButtonComponent.prototype._compareItems = function (item1, item2) {
16571
+ var _compare = function (a, b) {
16572
+ var e_1, _a;
16573
+ if (a === b) {
16574
+ return true;
16535
16575
  }
16536
- });
16537
- this._tieredMenuEventService.openItemMenuEvent
16538
- .pipe(operators.takeUntil(this._unsubscribe$))
16539
- .subscribe(function (item) {
16540
- var _a, _b;
16541
- if (!_this.tieredMenuService.currentItems.includes(item)) {
16542
- var itemAux = _this._lastOpenItem;
16543
- while ((_a = itemAux === null || itemAux === void 0 ? void 0 : itemAux.parent) === null || _a === void 0 ? void 0 : _a.parent) {
16544
- itemAux = itemAux.parent;
16576
+ if (a === undefined || b === undefined || typeof a !== "object" || a === null || typeof b !== "object" || b === null) {
16577
+ return false;
16578
+ }
16579
+ if (Array.isArray(a) !== Array.isArray(b)) {
16580
+ return false;
16581
+ }
16582
+ var keysA = Object.keys(a);
16583
+ var keysB = Object.keys(b);
16584
+ if (keysA.length !== keysB.length) {
16585
+ return false;
16586
+ }
16587
+ try {
16588
+ for (var keysA_1 = __values(keysA), keysA_1_1 = keysA_1.next(); !keysA_1_1.done; keysA_1_1 = keysA_1.next()) {
16589
+ var key = keysA_1_1.value;
16590
+ if (!keysB.includes(key) || !_compare(a[key], b[key])) {
16591
+ return false;
16592
+ }
16545
16593
  }
16546
- _this._tieredMenuEventService.closeItemMenuEvent.emit((_b = itemAux.parent) !== null && _b !== void 0 ? _b : itemAux);
16547
16594
  }
16548
- _this._lastOpenItem = item;
16549
- _this._openItem(item);
16550
- });
16551
- this._tieredMenuEventService.closeItemMenuEvent
16552
- .pipe(operators.takeUntil(this._unsubscribe$))
16553
- .subscribe(function (item) {
16554
- if (item) {
16555
- _this._closeItem(item);
16595
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
16596
+ finally {
16597
+ try {
16598
+ if (keysA_1_1 && !keysA_1_1.done && (_a = keysA_1.return)) _a.call(keysA_1);
16599
+ }
16600
+ finally { if (e_1) throw e_1.error; }
16556
16601
  }
16557
- });
16602
+ for (var key in a) {
16603
+ if (a.hasOwnProperty(key) !== b.hasOwnProperty(key)) {
16604
+ return false;
16605
+ }
16606
+ }
16607
+ return true;
16608
+ };
16609
+ return _compare(item1, item2);
16558
16610
  };
16559
- TieredMenuNestedComponent.ctorParameters = function () { return [
16560
- { type: TieredMenuService },
16561
- { type: TieredMenuEventService }
16611
+ var SelectButtonComponent_1;
16612
+ __decorate([
16613
+ core.Input()
16614
+ ], SelectButtonComponent.prototype, "items", void 0);
16615
+ __decorate([
16616
+ core.Input()
16617
+ ], SelectButtonComponent.prototype, "multiple", void 0);
16618
+ __decorate([
16619
+ core.Output()
16620
+ ], SelectButtonComponent.prototype, "itemSelected", void 0);
16621
+ __decorate([
16622
+ core.Output()
16623
+ ], SelectButtonComponent.prototype, "itemClicked", void 0);
16624
+ SelectButtonComponent = SelectButtonComponent_1 = __decorate([
16625
+ core.Component({
16626
+ selector: "s-select-button",
16627
+ 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>",
16628
+ providers: [
16629
+ {
16630
+ provide: forms.NG_VALUE_ACCESSOR,
16631
+ useExisting: core.forwardRef(function () { return SelectButtonComponent_1; }),
16632
+ multi: true,
16633
+ },
16634
+ ],
16635
+ styles: [".select-button{overflow:hidden}"]
16636
+ })
16637
+ ], SelectButtonComponent);
16638
+ return SelectButtonComponent;
16639
+ }());
16640
+
16641
+ var SelectButtonItemComponent = /** @class */ (function () {
16642
+ function SelectButtonItemComponent() {
16643
+ this.active = false;
16644
+ this.first = false;
16645
+ this.last = false;
16646
+ this.disabled = false;
16647
+ }
16648
+ __decorate([
16649
+ core.Input()
16650
+ ], SelectButtonItemComponent.prototype, "label", void 0);
16651
+ __decorate([
16652
+ core.Input()
16653
+ ], SelectButtonItemComponent.prototype, "active", void 0);
16654
+ __decorate([
16655
+ core.Input()
16656
+ ], SelectButtonItemComponent.prototype, "first", void 0);
16657
+ __decorate([
16658
+ core.Input()
16659
+ ], SelectButtonItemComponent.prototype, "last", void 0);
16660
+ __decorate([
16661
+ core.Input()
16662
+ ], SelectButtonItemComponent.prototype, "disabled", void 0);
16663
+ SelectButtonItemComponent = __decorate([
16664
+ core.Component({
16665
+ selector: "s-select-button-item",
16666
+ 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>",
16667
+ 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}"]
16668
+ })
16669
+ ], SelectButtonItemComponent);
16670
+ return SelectButtonItemComponent;
16671
+ }());
16672
+
16673
+ var SelectButtonModule = /** @class */ (function () {
16674
+ function SelectButtonModule() {
16675
+ }
16676
+ SelectButtonModule = __decorate([
16677
+ core.NgModule({
16678
+ imports: [common.CommonModule],
16679
+ declarations: [
16680
+ SelectButtonComponent,
16681
+ SelectButtonItemComponent,
16682
+ ],
16683
+ exports: [SelectButtonComponent],
16684
+ })
16685
+ ], SelectButtonModule);
16686
+ return SelectButtonModule;
16687
+ }());
16688
+
16689
+ var SidebarComponent = /** @class */ (function () {
16690
+ function SidebarComponent(focusTrapFactory) {
16691
+ this.focusTrapFactory = focusTrapFactory;
16692
+ this.id = "s-sidebar-" + SidebarComponent_1.nextId++;
16693
+ this.visible = false;
16694
+ this.baseZIndex = 0;
16695
+ this.largeSized = false;
16696
+ this.visibleChange = new core.EventEmitter();
16697
+ }
16698
+ SidebarComponent_1 = SidebarComponent;
16699
+ SidebarComponent.prototype.onShow = function () {
16700
+ dom.DomHandler.addClass(document.body, "ui-overflow-hidden-sidebar");
16701
+ var focusTrap = this.focusTrapFactory.create(this.innerSidebar.containerViewChild.nativeElement, false);
16702
+ focusTrap.focusInitialElementWhenReady();
16703
+ };
16704
+ SidebarComponent.prototype.onHide = function () {
16705
+ dom.DomHandler.removeClass(document.body, "ui-overflow-hidden-sidebar");
16706
+ };
16707
+ SidebarComponent.prototype.close = function (event) {
16708
+ dom.DomHandler.removeClass(document.body, "ui-overflow-hidden-sidebar");
16709
+ this.visibleChange.emit(false);
16710
+ event.preventDefault();
16711
+ };
16712
+ var SidebarComponent_1;
16713
+ SidebarComponent.nextId = 0;
16714
+ SidebarComponent.ctorParameters = function () { return [
16715
+ { type: a11y.FocusTrapFactory }
16562
16716
  ]; };
16563
16717
  __decorate([
16564
- core.HostListener("window:resize")
16565
- ], TieredMenuNestedComponent.prototype, "onResize", null);
16718
+ core.Input()
16719
+ ], SidebarComponent.prototype, "id", void 0);
16720
+ __decorate([
16721
+ core.Input()
16722
+ ], SidebarComponent.prototype, "visible", void 0);
16723
+ __decorate([
16724
+ core.Input()
16725
+ ], SidebarComponent.prototype, "header", void 0);
16726
+ __decorate([
16727
+ core.Input()
16728
+ ], SidebarComponent.prototype, "baseZIndex", void 0);
16566
16729
  __decorate([
16567
- core.HostListener("document:click", ["$event"])
16568
- ], TieredMenuNestedComponent.prototype, "onDocumentClick", null);
16730
+ core.Input()
16731
+ ], SidebarComponent.prototype, "largeSized", void 0);
16569
16732
  __decorate([
16570
- core.HostListener("document:keydown", ["$event"])
16571
- ], TieredMenuNestedComponent.prototype, "onKeydownHandler", null);
16572
- TieredMenuNestedComponent = __decorate([
16733
+ core.Output()
16734
+ ], SidebarComponent.prototype, "visibleChange", void 0);
16735
+ __decorate([
16736
+ core.ViewChild(sidebar.Sidebar, { static: true })
16737
+ ], SidebarComponent.prototype, "innerSidebar", void 0);
16738
+ __decorate([
16739
+ core.ContentChild(HeaderComponent, { static: true })
16740
+ ], SidebarComponent.prototype, "headerSection", void 0);
16741
+ __decorate([
16742
+ core.ContentChild(FooterComponent, { static: true })
16743
+ ], SidebarComponent.prototype, "footerSection", void 0);
16744
+ SidebarComponent = SidebarComponent_1 = __decorate([
16573
16745
  core.Component({
16574
- 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",
16575
- 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}"]
16746
+ selector: "s-sidebar",
16747
+ 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",
16748
+ encapsulation: core.ViewEncapsulation.None,
16749
+ 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}"]
16576
16750
  })
16577
- ], TieredMenuNestedComponent);
16578
- return TieredMenuNestedComponent;
16751
+ ], SidebarComponent);
16752
+ return SidebarComponent;
16579
16753
  }());
16580
16754
 
16581
- var TieredMenuComponent = /** @class */ (function () {
16582
- function TieredMenuComponent(_appRef, _componentFactoryResolver, _injector, _changeDetectorRef, tieredMenuService, _tieredMenuEventService) {
16583
- this._appRef = _appRef;
16584
- this._componentFactoryResolver = _componentFactoryResolver;
16585
- this._injector = _injector;
16586
- this._changeDetectorRef = _changeDetectorRef;
16587
- this.tieredMenuService = tieredMenuService;
16588
- this._tieredMenuEventService = _tieredMenuEventService;
16589
- this.top = 0;
16590
- this.left = 0;
16591
- this.menuTriggerEvent = "hover";
16592
- this._componentRef = null;
16593
- this._unsubscribe$ = new rxjs.Subject();
16594
- this.destroyRequest = new core.EventEmitter();
16755
+ var SidebarModule = /** @class */ (function () {
16756
+ function SidebarModule() {
16595
16757
  }
16596
- TieredMenuComponent_1 = TieredMenuComponent;
16597
- TieredMenuComponent.prototype.onResize = function () {
16598
- this._tieredMenuEventService.closeAllMenusEvent.emit();
16599
- };
16600
- TieredMenuComponent.prototype.onDocumentClick = function (event) {
16601
- // Closing menu when clicked outside.
16602
- var target = event.target;
16603
- var clickedInside = target.closest("s-tiered-menu-item") || target.closest("s-tiered-menu-divider");
16604
- if (!clickedInside) {
16605
- this._tieredMenuEventService.closeAllMenusEvent.emit();
16606
- }
16607
- };
16608
- TieredMenuComponent.prototype.onKeydownHandler = function (event) {
16609
- switch (event.key) {
16610
- case "Escape":
16611
- this._tieredMenuEventService.closeAllMenusEvent.emit();
16612
- break;
16613
- case " ":
16614
- case "Enter":
16615
- if (!this.tieredMenuService.currentItem.disabled) {
16616
- this._tieredMenuEventService.selectItemEvent.emit(this.tieredMenuService.currentItem);
16617
- }
16618
- break;
16619
- case "ArrowLeft":
16620
- if (this.items.includes(this.tieredMenuService.currentItem)) {
16621
- this._tieredMenuEventService.closeItemMenuEvent.emit(this.tieredMenuService.currentItem);
16622
- this._changeDetectorRef.detectChanges();
16623
- }
16624
- break;
16625
- case "ArrowRight":
16626
- if (!this.tieredMenuService.currentItem.disabled && this.items.includes(this.tieredMenuService.currentItem)) {
16627
- this._tieredMenuEventService.openItemMenuEvent.emit(this.tieredMenuService.currentItem);
16628
- event.stopImmediatePropagation();
16629
- }
16630
- break;
16631
- case "ArrowUp":
16632
- if (!this.tieredMenuService.currentItem || this.items.includes(this.tieredMenuService.currentItem)) {
16633
- this._tieredMenuEventService.decrementCurrentItemEvent.emit();
16634
- event.stopImmediatePropagation();
16635
- }
16636
- break;
16637
- case "ArrowDown":
16638
- if (!this.tieredMenuService.currentItem || this.items.includes(this.tieredMenuService.currentItem)) {
16639
- this._tieredMenuEventService.incrementCurrentItemEvent.emit();
16640
- event.stopImmediatePropagation();
16641
- }
16642
- break;
16643
- }
16644
- };
16645
- TieredMenuComponent.prototype.ngOnInit = function () {
16646
- this.tieredMenuService.currentItems = this.items;
16647
- this._subscribeEvents();
16758
+ SidebarModule = __decorate([
16759
+ core.NgModule({
16760
+ imports: [common.CommonModule, a11y.A11yModule, sidebar.SidebarModule, scrollpanel.ScrollPanelModule, StructureModule],
16761
+ declarations: [SidebarComponent],
16762
+ exports: [StructureModule, SidebarComponent],
16763
+ })
16764
+ ], SidebarModule);
16765
+ return SidebarModule;
16766
+ }());
16767
+
16768
+ var SlidePanelService = /** @class */ (function () {
16769
+ function SlidePanelService() {
16770
+ this.modalCloseMap = new Map();
16771
+ }
16772
+ SlidePanelService.prototype.createSlidePanel = function (id) {
16773
+ var panelSubject = new rxjs.Subject();
16774
+ this.modalCloseMap.set(id, panelSubject);
16775
+ return panelSubject.asObservable();
16648
16776
  };
16649
- TieredMenuComponent.prototype.ngOnDestroy = function () {
16650
- this._unsubscribe$.next();
16651
- this._unsubscribe$.complete();
16777
+ SlidePanelService.prototype.getModalCloseObservable = function (id) {
16778
+ return this.modalCloseMap.get(id).asObservable();
16652
16779
  };
16653
- TieredMenuComponent.prototype._incrementCurItem = function () {
16654
- if (!this.tieredMenuService.currentItem) {
16655
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
16656
- return;
16657
- }
16658
- else if (!this.items.includes(this.tieredMenuService.currentItem)) {
16659
- // Checking if it is the current menu.
16660
- return;
16661
- }
16662
- var currentIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) + 1;
16663
- if (currentIndex < this.tieredMenuService.currentItems.length) {
16664
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[currentIndex];
16665
- }
16666
- else {
16667
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
16668
- }
16669
- if (this.tieredMenuService.currentItem.divider) {
16670
- this._incrementCurItem();
16780
+ SlidePanelService.prototype.closeModal = function (id) {
16781
+ var subject = this.modalCloseMap.get(id);
16782
+ if (subject) {
16783
+ subject.next();
16671
16784
  }
16672
16785
  };
16673
- TieredMenuComponent.prototype._decrementCurItem = function () {
16674
- if (!this.tieredMenuService.currentItem) {
16675
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[0];
16676
- return;
16677
- // Checking if it is the current menu.
16678
- }
16679
- else if (!this.items.includes(this.tieredMenuService.currentItem)) {
16680
- return;
16681
- }
16682
- var curIndex = this.tieredMenuService.currentItems.indexOf(this.tieredMenuService.currentItem) - 1;
16683
- if (curIndex >= 0) {
16684
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[curIndex];
16685
- }
16686
- else {
16687
- this.tieredMenuService.currentItem = this.tieredMenuService.currentItems[this.tieredMenuService.currentItems.length - 1];
16688
- }
16689
- if (this.tieredMenuService.currentItem.divider) {
16690
- this._decrementCurItem();
16691
- }
16786
+ SlidePanelService = __decorate([
16787
+ core.Injectable()
16788
+ ], SlidePanelService);
16789
+ return SlidePanelService;
16790
+ }());
16791
+
16792
+ var SMALL_DEVICE_BREAKPOINT = 420;
16793
+ var SlidePanelComponent = /** @class */ (function () {
16794
+ function SlidePanelComponent(slidePanelService) {
16795
+ this.slidePanelService = slidePanelService;
16796
+ this.id = "slide-panel-" + ++SlidePanelComponent_1.nextId;
16797
+ this.openIcon = "fas fa-chevron-right";
16798
+ this.closeIcon = "fas fa-chevron-left";
16799
+ this.cache = false;
16800
+ this.createOpen = false;
16801
+ this.panelOpened = new core.EventEmitter();
16802
+ this.panelClosed = new core.EventEmitter();
16803
+ this.isOpen = false;
16804
+ this.isSlideOver = false;
16805
+ this.isAnimating = false;
16806
+ this.isContentAnimationDisabled = true;
16807
+ this.slideHeight = 0;
16808
+ this.sideContentWidth = 0;
16809
+ this._unsubscribe$ = new rxjs.Subject();
16810
+ }
16811
+ SlidePanelComponent_1 = SlidePanelComponent;
16812
+ SlidePanelComponent.prototype.onResize = function () {
16813
+ this._checkOverBehavior();
16692
16814
  };
16693
- TieredMenuComponent.prototype._createMenu = function (items, position) {
16815
+ SlidePanelComponent.prototype.ngOnInit = function () {
16694
16816
  var _this = this;
16695
- if (!this._componentRef && items) {
16696
- var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent_1);
16697
- this._componentRef = componentFactory.create(this._injector);
16698
- this._appRef.attachView(this._componentRef.hostView);
16699
- var domElem = this._componentRef.hostView.rootNodes[0];
16700
- document.body.appendChild(domElem);
16701
- // Setting the menu items.
16702
- this._componentRef.instance.items = items;
16703
- // Subscribe menu events.
16704
- this._componentRef.instance.destroyRequest.subscribe(function (propagate) {
16705
- _this._destroy(propagate);
16706
- });
16707
- this._menuDivElement = domElem.querySelector(".menu");
16708
- this._setMenuPosition(position);
16709
- }
16710
- };
16711
- TieredMenuComponent.prototype._destroy = function (propagate) {
16712
- if (propagate === void 0) { propagate = true; }
16713
- if (this._componentRef !== null) {
16714
- this._appRef.detachView(this._componentRef.hostView);
16715
- this._componentRef.destroy();
16716
- this._componentRef = null;
16717
- this._menuDivElement = null;
16718
- }
16719
- if (propagate) {
16720
- this.destroyRequest.emit();
16721
- }
16722
- };
16723
- TieredMenuComponent.prototype._setMenuPosition = function (position) {
16724
- var _a, _b;
16725
- var ITEM_HEIGHT = 37;
16726
- var DIVIDER_HEIGHT = 5;
16727
- var PADDING = 8;
16728
- if (this._componentRef !== null) {
16729
- var top_1 = position.top, right = position.right, bottom = position.bottom, left = position.left;
16730
- var itemsCount = (_a = this._componentRef.instance.items) === null || _a === void 0 ? void 0 : _a.reduce(function (count, item) {
16731
- return !item.divider ? count + 1 : count;
16732
- }, 0);
16733
- var dividersCount = (_b = this._componentRef.instance.items) === null || _b === void 0 ? void 0 : _b.reduce(function (count, item) {
16734
- return item.divider ? count + 1 : count;
16735
- }, 0);
16736
- // I need to calculate the height of the component because the internal elements have not been created yet.
16737
- var menuHeight = itemsCount * ITEM_HEIGHT + dividersCount * DIVIDER_HEIGHT + PADDING + 8;
16738
- var menuWidth = this._menuDivElement.getBoundingClientRect().width;
16739
- var rightFreeSpace = window.innerWidth - right;
16740
- var bottomFreeSpace = window.innerHeight - bottom;
16741
- if (rightFreeSpace > menuWidth) {
16742
- this._componentRef.instance.left = right;
16743
- }
16744
- else {
16745
- this._componentRef.instance.left = left - menuWidth;
16746
- }
16747
- if (bottomFreeSpace <= menuHeight) {
16748
- this._componentRef.instance.top = Math.max(window.innerHeight - menuHeight, window.scrollY);
16749
- }
16750
- else {
16751
- this._componentRef.instance.top = window.scrollY + top_1;
16752
- }
16753
- }
16817
+ this._checkOverBehavior();
16818
+ this.slidePanelService.createSlidePanel(this.id)
16819
+ .pipe(operators.takeUntil(this._unsubscribe$))
16820
+ .subscribe(function () {
16821
+ _this.isOpen = false;
16822
+ });
16754
16823
  };
16755
- TieredMenuComponent.prototype._subscribeEvents = function () {
16824
+ SlidePanelComponent.prototype.ngAfterViewInit = function () {
16756
16825
  var _this = this;
16757
- // Increment current item event.
16758
- this._tieredMenuEventService.incrementCurrentItemEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
16759
- _this._incrementCurItem();
16760
- });
16761
- // Decrement current item event.
16762
- this._tieredMenuEventService.decrementCurrentItemEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
16763
- _this._decrementCurItem();
16764
- });
16765
- // Select item event.
16766
- this._tieredMenuEventService.selectItemEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function (item) {
16767
- if (item.submenu) {
16768
- _this._tieredMenuEventService.openItemMenuEvent.emit(item);
16769
- }
16770
- else if (item.command) {
16771
- _this._tieredMenuEventService.closeAllMenusEvent.emit();
16772
- item.command();
16773
- }
16774
- });
16775
- // Close all menus event.
16776
- this._tieredMenuEventService.closeAllMenusEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
16777
- _this._destroy();
16778
- _this.tieredMenuService.currentItem = null;
16779
- _this.tieredMenuService.currentItems = _this.tieredMenuService.items;
16780
- _this.tieredMenuService.markAllItemsAsClosed(_this.tieredMenuService.items);
16781
- });
16782
- // Open item menu event.
16783
- this._tieredMenuEventService.openItemMenuEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function (item) {
16784
- if (_this.tieredMenuService.currentItem) {
16785
- if (_this.tieredMenuService.currentItem.parent === item) {
16786
- return;
16787
- }
16788
- if (!_this.tieredMenuService.searchTheHierarchy(_this.tieredMenuService.currentItem.parent, item)) {
16789
- var current = _this.tieredMenuService.currentItem;
16790
- current.isOpen = false;
16791
- while ((current === null || current === void 0 ? void 0 : current.parent) !== item.parent) {
16792
- _this._tieredMenuEventService.closeItemMenuEvent.emit(current);
16793
- _this._changeDetectorRef.detectChanges();
16794
- current = current.parent;
16795
- }
16796
- if (current) {
16797
- current.isOpen = false;
16798
- }
16799
- }
16800
- }
16801
- if (item.submenu && !item.isOpen && _this.items.includes(item)) {
16802
- var _a = document.querySelector("#" + item.id).getBoundingClientRect(), top_2 = _a.top, right = _a.right, left = _a.left, bottom = _a.bottom;
16803
- var position = { top: top_2, right: right, left: left, bottom: bottom };
16804
- _this._createMenu(item.submenu, position);
16805
- _this.tieredMenuService.currentItems = item.submenu;
16806
- _this.tieredMenuService.currentItem = item.submenu[0];
16807
- item.isOpen = true;
16826
+ queueMicrotask(function () {
16827
+ if (_this.createOpen) {
16828
+ _this.isOpen = true;
16808
16829
  }
16809
16830
  });
16810
- // Close item menu event.
16811
- this._tieredMenuEventService.closeItemMenuEvent
16812
- .pipe(operators.takeUntil(this._unsubscribe$))
16813
- .subscribe(function (item) {
16814
- var _a, _b;
16815
- if (_this.items.some(function (i) { return i.id === item.id; })) {
16816
- if (item.parent) {
16817
- item.parent.isOpen = false;
16818
- }
16819
- _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;
16820
- _this.tieredMenuService.currentItem = item.parent;
16821
- _this.destroyRequest.emit(false);
16822
- }
16831
+ };
16832
+ SlidePanelComponent.prototype.ngAfterViewChecked = function () {
16833
+ var _this = this;
16834
+ // to executed at a safe time prior to control returning to the browser's event loop
16835
+ queueMicrotask(function () {
16836
+ _this._calculateSlideHeight();
16837
+ _this._calculateSideContentWidth();
16838
+ _this.isContentAnimationDisabled = false;
16823
16839
  });
16824
16840
  };
16825
- var TieredMenuComponent_1;
16826
- TieredMenuComponent.ctorParameters = function () { return [
16827
- { type: core.ApplicationRef },
16828
- { type: core.ComponentFactoryResolver },
16829
- { type: core.Injector },
16830
- { type: core.ChangeDetectorRef },
16831
- { type: TieredMenuService },
16832
- { type: TieredMenuEventService }
16841
+ SlidePanelComponent.prototype.ngOnDestroy = function () {
16842
+ this._unsubscribe$.next();
16843
+ this._unsubscribe$.complete();
16844
+ };
16845
+ SlidePanelComponent.prototype.onClickButton = function () {
16846
+ if (this.isAnimating) {
16847
+ return;
16848
+ }
16849
+ this.isOpen = !this.isOpen;
16850
+ if (this.isOpen) {
16851
+ this.panelOpened.emit();
16852
+ }
16853
+ else {
16854
+ this.panelClosed.emit();
16855
+ }
16856
+ };
16857
+ SlidePanelComponent.prototype.onContentAnimationStart = function () {
16858
+ this.isAnimating = true;
16859
+ };
16860
+ SlidePanelComponent.prototype.onContentAnimationDone = function () {
16861
+ this.isAnimating = false;
16862
+ this._calculateSideContentWidth();
16863
+ };
16864
+ SlidePanelComponent.prototype._checkOverBehavior = function () {
16865
+ this.isSlideOver = window.innerWidth <= SMALL_DEVICE_BREAKPOINT;
16866
+ };
16867
+ SlidePanelComponent.prototype._calculateSlideHeight = function () {
16868
+ this.slideHeight = this._sideContentRef.nativeElement.clientHeight;
16869
+ };
16870
+ SlidePanelComponent.prototype._calculateSideContentWidth = function () {
16871
+ var slidePanelWidth = this._slidePanelRef.nativeElement.getBoundingClientRect().width;
16872
+ var slideContentWidth = this._slideContentRef.nativeElement.getBoundingClientRect().width;
16873
+ this.sideContentWidth = slidePanelWidth - slideContentWidth;
16874
+ };
16875
+ var SlidePanelComponent_1;
16876
+ SlidePanelComponent.nextId = 0;
16877
+ SlidePanelComponent.ctorParameters = function () { return [
16878
+ { type: SlidePanelService }
16833
16879
  ]; };
16880
+ __decorate([
16881
+ core.Input()
16882
+ ], SlidePanelComponent.prototype, "id", void 0);
16883
+ __decorate([
16884
+ core.Input()
16885
+ ], SlidePanelComponent.prototype, "openIcon", void 0);
16886
+ __decorate([
16887
+ core.Input()
16888
+ ], SlidePanelComponent.prototype, "closeIcon", void 0);
16889
+ __decorate([
16890
+ core.Input()
16891
+ ], SlidePanelComponent.prototype, "cache", void 0);
16892
+ __decorate([
16893
+ core.Input()
16894
+ ], SlidePanelComponent.prototype, "createOpen", void 0);
16834
16895
  __decorate([
16835
16896
  core.Output()
16836
- ], TieredMenuComponent.prototype, "destroyRequest", void 0);
16897
+ ], SlidePanelComponent.prototype, "panelOpened", void 0);
16837
16898
  __decorate([
16838
- core.HostListener("window:resize")
16839
- ], TieredMenuComponent.prototype, "onResize", null);
16899
+ core.Output()
16900
+ ], SlidePanelComponent.prototype, "panelClosed", void 0);
16840
16901
  __decorate([
16841
- core.HostListener("document:click", ["$event"])
16842
- ], TieredMenuComponent.prototype, "onDocumentClick", null);
16902
+ core.ViewChild("slidePanel")
16903
+ ], SlidePanelComponent.prototype, "_slidePanelRef", void 0);
16843
16904
  __decorate([
16844
- core.HostListener("document:keydown", ["$event"])
16845
- ], TieredMenuComponent.prototype, "onKeydownHandler", null);
16846
- TieredMenuComponent = TieredMenuComponent_1 = __decorate([
16905
+ core.ViewChild("slideContent")
16906
+ ], SlidePanelComponent.prototype, "_slideContentRef", void 0);
16907
+ __decorate([
16908
+ core.ViewChild("sideContent")
16909
+ ], SlidePanelComponent.prototype, "_sideContentRef", void 0);
16910
+ __decorate([
16911
+ core.HostListener("window:resize")
16912
+ ], SlidePanelComponent.prototype, "onResize", null);
16913
+ SlidePanelComponent = SlidePanelComponent_1 = __decorate([
16847
16914
  core.Component({
16848
- selector: "s-tiered-menu",
16849
- 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>",
16850
- 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}"]
16915
+ selector: "s-slide-panel",
16916
+ 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>",
16917
+ animations: [
16918
+ animations.trigger("cachelessAnimation", [
16919
+ animations.transition(":enter", [
16920
+ animations.style({ width: "0" }),
16921
+ animations.animate("200ms linear", animations.style({ width: "*" })),
16922
+ ]),
16923
+ animations.transition(":leave", [
16924
+ animations.style({ width: "*" }),
16925
+ animations.animate("200ms linear", animations.style({ width: "0" })),
16926
+ ]),
16927
+ ]),
16928
+ animations.trigger("cacheAnimation", [
16929
+ animations.state("true", animations.style({ width: "*", padding: '0 16px' })),
16930
+ animations.state("false", animations.style({ width: '0px', padding: '0' })),
16931
+ animations.transition("* => *", animations.animate("200ms")),
16932
+ ]),
16933
+ ],
16934
+ 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}"]
16851
16935
  })
16852
- ], TieredMenuComponent);
16853
- return TieredMenuComponent;
16936
+ ], SlidePanelComponent);
16937
+ return SlidePanelComponent;
16854
16938
  }());
16855
16939
 
16856
- var TieredMenuGlobalService = /** @class */ (function () {
16857
- function TieredMenuGlobalService() {
16940
+ var SlidePanelModule = /** @class */ (function () {
16941
+ function SlidePanelModule() {
16858
16942
  }
16859
- TieredMenuGlobalService = __decorate([
16860
- core.Injectable()
16861
- ], TieredMenuGlobalService);
16862
- return TieredMenuGlobalService;
16943
+ SlidePanelModule = __decorate([
16944
+ core.NgModule({
16945
+ imports: [common.CommonModule],
16946
+ declarations: [SlidePanelComponent],
16947
+ exports: [SlidePanelComponent],
16948
+ providers: [SlidePanelService],
16949
+ })
16950
+ ], SlidePanelModule);
16951
+ return SlidePanelModule;
16863
16952
  }());
16864
16953
 
16865
- var TieredMenuDirective = /** @class */ (function () {
16866
- function TieredMenuDirective(_elementRef, _appRef, _componentFactoryResolver, _injector, _tieredMenuEventService, _tieredMenuService, _tieredMenuGlobalService, _changeDetectorRef) {
16867
- this._elementRef = _elementRef;
16868
- this._appRef = _appRef;
16869
- this._componentFactoryResolver = _componentFactoryResolver;
16870
- this._injector = _injector;
16871
- this._tieredMenuEventService = _tieredMenuEventService;
16872
- this._tieredMenuService = _tieredMenuService;
16873
- this._tieredMenuGlobalService = _tieredMenuGlobalService;
16874
- this._changeDetectorRef = _changeDetectorRef;
16875
- this.items = [];
16876
- this.triggerEvent = "click";
16877
- this._componentRef = null;
16878
- this._isNested = false;
16879
- this._isOpen = false;
16880
- this._unsubscribe$ = new rxjs.Subject();
16881
- }
16882
- TieredMenuDirective.prototype.onClick = function (event) {
16883
- if (this.triggerEvent === "click" && !this._isOpen) {
16884
- this._lastActiveElement = document.activeElement;
16885
- this._createMenu();
16886
- event.preventDefault();
16887
- event.stopPropagation();
16888
- }
16889
- };
16890
- TieredMenuDirective.prototype.ngOnInit = function () {
16891
- this._subscribeEvents();
16892
- };
16893
- TieredMenuDirective.prototype.ngDoCheck = function () {
16894
- if (!this.previousItems) {
16895
- this.previousItems = this._tieredMenuService.cloneItems(this.items);
16896
- }
16897
- var hasChanges = false;
16898
- if (this.items.length !== this.previousItems.length) {
16899
- hasChanges = true;
16900
- }
16901
- else {
16902
- for (var i = 0; i < this.items.length; i++) {
16903
- if (!this._compareItems(this.items[i], this.previousItems[i])) {
16904
- hasChanges = true;
16905
- break;
16906
- }
16907
- }
16908
- }
16909
- if (hasChanges) {
16910
- this._updateServiceItems();
16911
- this._changeDetectorRef.detectChanges();
16912
- this._rebuildMenu();
16954
+
16955
+ (function (SplitButtonType) {
16956
+ SplitButtonType["Primary"] = "primary";
16957
+ SplitButtonType["Secondary"] = "secondary";
16958
+ SplitButtonType["Default"] = "default";
16959
+ })(exports.SplitButtonType || (exports.SplitButtonType = {}));
16960
+
16961
+ var SplitButtonComponent = /** @class */ (function () {
16962
+ function SplitButtonComponent(eRef) {
16963
+ this.eRef = eRef;
16964
+ this.disabled = false;
16965
+ this.type = exports.SplitButtonType.Primary;
16966
+ this.buttonClicked = new core.EventEmitter();
16967
+ this.open = false;
16968
+ }
16969
+ SplitButtonComponent.prototype.onClickout = function (event) {
16970
+ if (!this.eRef.nativeElement.contains(event.target)) {
16971
+ this.closeDropdown();
16913
16972
  }
16914
- this.previousItems = this._tieredMenuService.cloneItems(this.items);
16915
- };
16916
- TieredMenuDirective.prototype.ngOnDestroy = function () {
16917
- this._unsubscribe$.next();
16918
- this._unsubscribe$.complete();
16919
- this._destroy();
16920
16973
  };
16921
- TieredMenuDirective.prototype._createMenu = function () {
16922
- var _a, _b, _c;
16923
- this._updateServiceItems();
16924
- if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
16925
- (_b = this._tieredMenuGlobalService.lastInstance) === null || _b === void 0 ? void 0 : _b._destroy();
16926
- this._tieredMenuGlobalService.lastInstance = this;
16927
- (_c = this._lastActiveElement) === null || _c === void 0 ? void 0 : _c.blur();
16928
- this._isOpen = true;
16929
- this._isNested = document.body.clientWidth < 600;
16930
- this._isNested ? this._createNestedMenu() : this._createTieredMenu();
16974
+ SplitButtonComponent.prototype.onButtonClick = function () {
16975
+ if (!this.disabled) {
16976
+ this.buttonClicked.emit();
16977
+ this.closeDropdown();
16931
16978
  }
16932
16979
  };
16933
- TieredMenuDirective.prototype._createTieredMenu = function () {
16934
- var _this = this;
16935
- var _a;
16936
- if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
16937
- var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuComponent);
16938
- this._componentRef = componentFactory.create(this._injector);
16939
- this._appRef.attachView(this._componentRef.hostView);
16940
- var domElem = this._componentRef.hostView.rootNodes[0];
16941
- document.body.appendChild(domElem);
16942
- this._setMenuComponentProperties();
16943
- this._componentRef.instance.destroyRequest.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
16944
- _this._destroy();
16945
- });
16946
- this._setMenuPosition();
16980
+ SplitButtonComponent.prototype.onDropdownClick = function () {
16981
+ if (!this.disabled) {
16982
+ this.open = !this.open;
16947
16983
  }
16948
16984
  };
16949
- TieredMenuDirective.prototype._createNestedMenu = function () {
16950
- var _a;
16951
- if (!this._componentRef && ((_a = this._tieredMenuService.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
16952
- var componentFactory = this._componentFactoryResolver.resolveComponentFactory(TieredMenuNestedComponent);
16953
- this._componentRef = componentFactory.create(this._injector);
16954
- this._appRef.attachView(this._componentRef.hostView);
16955
- var domElem = this._componentRef.hostView.rootNodes[0];
16956
- document.body.appendChild(domElem);
16957
- this._setMenuComponentProperties();
16958
- this._setMenuPosition();
16959
- }
16985
+ SplitButtonComponent.prototype.onOptionClick = function (option) {
16986
+ option.action && option.action();
16987
+ this.closeDropdown();
16960
16988
  };
16961
- TieredMenuDirective.prototype._destroy = function () {
16962
- if (this._componentRef) {
16963
- this._isOpen = false;
16964
- window.clearTimeout(this._showTimeout);
16965
- this._appRef.detachView(this._componentRef.hostView);
16966
- this._componentRef.destroy();
16967
- this._componentRef = null;
16968
- this._tieredMenuService.currentItems = this._tieredMenuService.items;
16969
- this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
16970
- this._tieredMenuEventService.closeAllMenusEvent.emit();
16971
- }
16989
+ SplitButtonComponent.prototype.closeDropdown = function () {
16990
+ this.open = false;
16972
16991
  };
16973
- TieredMenuDirective.prototype._setMenuPosition = function () {
16974
- var _a, _b;
16975
- var ITEM_HEIGHT = 37;
16976
- var ITEM_WIDTH = 176;
16977
- var DIVIDER_HEIGHT = 5;
16978
- var PADDING = 8;
16979
- var MARGIN = 4;
16980
- if (this._componentRef !== null) {
16981
- this._componentRef.instance.top = 8;
16982
- var _c = this._elementRef.nativeElement.getBoundingClientRect(), bottom = _c.bottom, left = _c.left, right = _c.right;
16983
- var itemsCount = (_a = this._componentRef.instance.items) === null || _a === void 0 ? void 0 : _a.reduce(function (count, item) {
16984
- return !item.divider ? count + 1 : count;
16985
- }, 0);
16986
- var dividersCount = (_b = this._componentRef.instance.items) === null || _b === void 0 ? void 0 : _b.reduce(function (count, item) {
16987
- return item.divider ? count + 1 : count;
16988
- }, 0);
16989
- var menuHeight = itemsCount * ITEM_HEIGHT + dividersCount * DIVIDER_HEIGHT + PADDING + MARGIN;
16990
- var rightFreeSpace = window.innerWidth - right;
16991
- var bottomFreeSpace = window.innerHeight - bottom;
16992
- this._componentRef.instance.top = bottom;
16993
- this._componentRef.instance.left = left;
16994
- if (bottomFreeSpace <= menuHeight) {
16995
- this._componentRef.instance.top = Math.max(scrollY + bottom - menuHeight, 0);
16996
- }
16997
- else {
16998
- this._componentRef.instance.top = window.scrollY + bottom + MARGIN;
16992
+ SplitButtonComponent.ctorParameters = function () { return [
16993
+ { type: core.ElementRef }
16994
+ ]; };
16995
+ __decorate([
16996
+ core.Input()
16997
+ ], SplitButtonComponent.prototype, "disabled", void 0);
16998
+ __decorate([
16999
+ core.Input()
17000
+ ], SplitButtonComponent.prototype, "iconClass", void 0);
17001
+ __decorate([
17002
+ core.Input()
17003
+ ], SplitButtonComponent.prototype, "label", void 0);
17004
+ __decorate([
17005
+ core.Input()
17006
+ ], SplitButtonComponent.prototype, "type", void 0);
17007
+ __decorate([
17008
+ core.Input()
17009
+ ], SplitButtonComponent.prototype, "options", void 0);
17010
+ __decorate([
17011
+ core.Output()
17012
+ ], SplitButtonComponent.prototype, "buttonClicked", void 0);
17013
+ __decorate([
17014
+ core.HostListener("document:click", ["$event"])
17015
+ ], SplitButtonComponent.prototype, "onClickout", null);
17016
+ SplitButtonComponent = __decorate([
17017
+ core.Component({
17018
+ selector: "s-split-button",
17019
+ 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>",
17020
+ 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}"]
17021
+ })
17022
+ ], SplitButtonComponent);
17023
+ return SplitButtonComponent;
17024
+ }());
17025
+
17026
+ var SplitButtonModule = /** @class */ (function () {
17027
+ function SplitButtonModule() {
17028
+ }
17029
+ SplitButtonModule = __decorate([
17030
+ core.NgModule({
17031
+ imports: [common.CommonModule],
17032
+ declarations: [SplitButtonComponent],
17033
+ exports: [SplitButtonComponent],
17034
+ })
17035
+ ], SplitButtonModule);
17036
+ return SplitButtonModule;
17037
+ }());
17038
+
17039
+ var StatsCardComponent = /** @class */ (function () {
17040
+ function StatsCardComponent() {
17041
+ this.id = "s-stats-card-" + StatsCardComponent_1.nextId++;
17042
+ this.alwaysWithBorder = false;
17043
+ this.lightVersion = false;
17044
+ this.lightMode = true;
17045
+ this.iconClass = "fa fa-bar-chart";
17046
+ this.color = "#339966";
17047
+ this.animateNumbers = true;
17048
+ this.clickable = false;
17049
+ this.tooltip = "";
17050
+ this.onClick = new core.EventEmitter();
17051
+ this.ANIMATION_DURATION_MS = 200;
17052
+ this.STEP_DURATION_MS = 20;
17053
+ this.previousValue = "0";
17054
+ this._value = "0";
17055
+ }
17056
+ StatsCardComponent_1 = StatsCardComponent;
17057
+ Object.defineProperty(StatsCardComponent.prototype, "value", {
17058
+ get: function () {
17059
+ return this._value;
17060
+ },
17061
+ set: function (value) {
17062
+ this.previousValue = this._value;
17063
+ this._value = String(value);
17064
+ if (this.animateNumbers)
17065
+ this.updateDisplayValue();
17066
+ else
17067
+ this.displayValue = this.value;
17068
+ },
17069
+ enumerable: true,
17070
+ configurable: true
17071
+ });
17072
+ StatsCardComponent.prototype.updateDisplayValue = function () {
17073
+ var _this = this;
17074
+ var animationDuration = new BigNumber.BigNumber(this.ANIMATION_DURATION_MS);
17075
+ var stepDuration = new BigNumber.BigNumber(this.STEP_DURATION_MS);
17076
+ var animationCount = animationDuration.dividedBy(stepDuration);
17077
+ var previousRawValue = new BigNumber.BigNumber(this.previousValue.replace(/\D/g, ""));
17078
+ var rawValue = new BigNumber.BigNumber(this.value.replace(/\D/g, ""));
17079
+ var incrementValue = rawValue.minus(previousRawValue).absoluteValue().dividedBy(animationCount);
17080
+ var incremental = previousRawValue.isLessThan(rawValue);
17081
+ clearInterval(this.intervalId);
17082
+ this.displayValue = this.replaceNumericPositions(this.value);
17083
+ var counter = previousRawValue;
17084
+ this.intervalId = setInterval(function () {
17085
+ if (incremental && counter.isLessThan(rawValue)) {
17086
+ _this.displayValue = _this.replaceNumericPositions(_this.displayValue, counter);
17087
+ counter = counter.plus(incrementValue);
16999
17088
  }
17000
- if (rightFreeSpace > 176) {
17001
- this._componentRef.instance.left = window.scrollX + left;
17089
+ else if (!incremental && counter.isGreaterThan(rawValue)) {
17090
+ _this.displayValue = _this.replaceNumericPositions(_this.displayValue, counter);
17091
+ counter = counter.minus(incrementValue);
17002
17092
  }
17003
17093
  else {
17004
- this._componentRef.instance.left = window.scrollX + right - ITEM_WIDTH;
17005
- }
17006
- if (this._isNested) {
17007
- this._componentRef.instance.left = MARGIN;
17094
+ _this.displayValue = _this.value;
17095
+ clearInterval(_this.intervalId);
17008
17096
  }
17009
- }
17010
- };
17011
- TieredMenuDirective.prototype._setMenuComponentProperties = function () {
17012
- if (this._componentRef != null) {
17013
- this._componentRef.instance.items = this._tieredMenuService.items;
17014
- }
17015
- };
17016
- TieredMenuDirective.prototype._subscribeEvents = function () {
17017
- var _this = this;
17018
- this._tieredMenuEventService.closeAllMenusEvent.pipe(operators.takeUntil(this._unsubscribe$)).subscribe(function () {
17019
- _this._tieredMenuService.items = _this._tieredMenuService.markAllItemsAsClosed(_this._tieredMenuService.items);
17020
- _this._destroy();
17021
- });
17022
- };
17023
- TieredMenuDirective.prototype._compareItems = function (item1, item2) {
17024
- return JSON.stringify(item1) === JSON.stringify(item2);
17025
- };
17026
- TieredMenuDirective.prototype._rebuildMenu = function () {
17027
- this._destroy();
17097
+ }, this.STEP_DURATION_MS);
17028
17098
  };
17029
- TieredMenuDirective.prototype._updateServiceItems = function () {
17030
- this._tieredMenuService.items = this._tieredMenuService.normalizeData(this.items);
17031
- this._tieredMenuService.currentItems = this._tieredMenuService.items;
17032
- this._tieredMenuService.currentItem = this._tieredMenuService.items[0];
17099
+ StatsCardComponent.prototype.replaceNumericPositions = function (value, newValue) {
17100
+ var rawValue = value.replace(/[^\d]/g, "");
17101
+ var newValueString = newValue ? newValue.toString() : "";
17102
+ var formattedNewValue = newValueString
17103
+ .toString()
17104
+ .replace(/\D/g, "")
17105
+ .padStart(rawValue.length, "0");
17106
+ var newValueIndex = 0;
17107
+ return value
17108
+ .split("")
17109
+ .map(function (char) {
17110
+ var number = Number(char);
17111
+ if (number || char === "0")
17112
+ return formattedNewValue[newValueIndex++];
17113
+ return char;
17114
+ })
17115
+ .join("");
17033
17116
  };
17034
- TieredMenuDirective.ctorParameters = function () { return [
17035
- { type: core.ElementRef },
17036
- { type: core.ApplicationRef },
17037
- { type: core.ComponentFactoryResolver },
17038
- { type: core.Injector },
17039
- { type: TieredMenuEventService },
17040
- { type: TieredMenuService },
17041
- { type: TieredMenuGlobalService },
17042
- { type: core.ChangeDetectorRef }
17043
- ]; };
17117
+ var StatsCardComponent_1;
17118
+ StatsCardComponent.nextId = 0;
17044
17119
  __decorate([
17045
17120
  core.Input()
17046
- ], TieredMenuDirective.prototype, "items", void 0);
17121
+ ], StatsCardComponent.prototype, "id", void 0);
17047
17122
  __decorate([
17048
17123
  core.Input()
17049
- ], TieredMenuDirective.prototype, "triggerEvent", void 0);
17124
+ ], StatsCardComponent.prototype, "label", void 0);
17050
17125
  __decorate([
17051
- core.HostListener("click", ["$event"])
17052
- ], TieredMenuDirective.prototype, "onClick", null);
17053
- TieredMenuDirective = __decorate([
17054
- core.Directive({
17055
- selector: "[sTieredMenu]",
17056
- providers: [TieredMenuEventService, TieredMenuService],
17126
+ core.Input()
17127
+ ], StatsCardComponent.prototype, "alwaysWithBorder", void 0);
17128
+ __decorate([
17129
+ core.Input()
17130
+ ], StatsCardComponent.prototype, "lightVersion", void 0);
17131
+ __decorate([
17132
+ core.Input()
17133
+ ], StatsCardComponent.prototype, "lightMode", void 0);
17134
+ __decorate([
17135
+ core.Input()
17136
+ ], StatsCardComponent.prototype, "iconClass", void 0);
17137
+ __decorate([
17138
+ core.Input()
17139
+ ], StatsCardComponent.prototype, "color", void 0);
17140
+ __decorate([
17141
+ core.Input()
17142
+ ], StatsCardComponent.prototype, "animateNumbers", void 0);
17143
+ __decorate([
17144
+ core.Input()
17145
+ ], StatsCardComponent.prototype, "clickable", void 0);
17146
+ __decorate([
17147
+ core.Input()
17148
+ ], StatsCardComponent.prototype, "value", null);
17149
+ __decorate([
17150
+ core.Input()
17151
+ ], StatsCardComponent.prototype, "tooltip", void 0);
17152
+ __decorate([
17153
+ core.Output()
17154
+ ], StatsCardComponent.prototype, "onClick", void 0);
17155
+ StatsCardComponent = StatsCardComponent_1 = __decorate([
17156
+ core.Component({
17157
+ selector: "s-stats-card",
17158
+ 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",
17159
+ encapsulation: core.ViewEncapsulation.None,
17160
+ 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}}"]
17057
17161
  })
17058
- ], TieredMenuDirective);
17059
- return TieredMenuDirective;
17162
+ ], StatsCardComponent);
17163
+ return StatsCardComponent;
17060
17164
  }());
17061
17165
 
17062
- var TieredMenuDividerComponent = /** @class */ (function () {
17063
- function TieredMenuDividerComponent() {
17166
+ var StatsCardModule = /** @class */ (function () {
17167
+ function StatsCardModule() {
17064
17168
  }
17065
- TieredMenuDividerComponent = __decorate([
17066
- core.Component({
17067
- selector: "s-tiered-menu-divider",
17068
- template: "<div class=\"divider\"></div>",
17069
- styles: [".divider{margin:2px 0;height:1px;background-color:#ccc}"]
17169
+ StatsCardModule = __decorate([
17170
+ core.NgModule({
17171
+ imports: [
17172
+ common.CommonModule,
17173
+ tooltip.TooltipModule,
17174
+ ],
17175
+ declarations: [
17176
+ StatsCardComponent,
17177
+ ],
17178
+ exports: [
17179
+ StatsCardComponent,
17180
+ ],
17070
17181
  })
17071
- ], TieredMenuDividerComponent);
17072
- return TieredMenuDividerComponent;
17182
+ ], StatsCardModule);
17183
+ return StatsCardModule;
17073
17184
  }());
17074
17185
 
17075
- var TieredMenuItemComponent = /** @class */ (function () {
17076
- function TieredMenuItemComponent(_tieredMenuEventService) {
17077
- this._tieredMenuEventService = _tieredMenuEventService;
17078
- this.focused = false;
17079
- this.highlight = false;
17080
- this.triggerEvent = "click";
17081
- this.closeOnClick = false;
17186
+
17187
+ (function (StepState) {
17188
+ StepState["Default"] = "default";
17189
+ StepState["Success"] = "success";
17190
+ StepState["Warning"] = "warning";
17191
+ })(exports.StepState || (exports.StepState = {}));
17192
+ var StepsComponent = /** @class */ (function () {
17193
+ function StepsComponent() {
17194
+ this.id = "s-steps-" + StepsComponent_1.nextId++;
17195
+ this.activeIndex = 0;
17196
+ this.stepSelected = new core.EventEmitter();
17082
17197
  }
17083
- TieredMenuItemComponent.prototype.onClick = function () {
17084
- if (this.item.disabled)
17198
+ StepsComponent_1 = StepsComponent;
17199
+ StepsComponent.prototype.stepClick = function (step, index, event) {
17200
+ if (step.disabled || index == this.activeIndex)
17085
17201
  return;
17086
- if (this.item.submenu) {
17087
- if (!this.item.isOpen) {
17088
- this._tieredMenuEventService.openItemMenuEvent.emit(this.item);
17089
- }
17090
- else if (this.closeOnClick) {
17091
- this._tieredMenuEventService.closeItemMenuEvent.emit(this.item);
17092
- }
17093
- }
17094
- else {
17095
- this._tieredMenuEventService.selectItemEvent.emit(this.item);
17096
- }
17202
+ this.stepSelected.emit({ step: step, index: index, event: event });
17097
17203
  };
17098
- TieredMenuItemComponent.prototype.onMouseEnter = function () {
17099
- var _this = this;
17100
- if (this.item.disabled)
17101
- return;
17102
- if (this.triggerEvent === "hover" && !this.item.isOpen) {
17103
- this._showTimeout = window.setTimeout(function () {
17104
- _this._tieredMenuEventService.openItemMenuEvent.emit(_this.item);
17105
- }, 300);
17106
- }
17204
+ Object.defineProperty(StepsComponent.prototype, "stepState", {
17205
+ get: function () {
17206
+ return exports.StepState;
17207
+ },
17208
+ enumerable: true,
17209
+ configurable: true
17210
+ });
17211
+ StepsComponent.prototype.barAnimation = function (index, activeIndex) {
17212
+ var visited = index < activeIndex;
17213
+ var activated = index === activeIndex;
17214
+ return visited || activated;
17107
17215
  };
17108
- TieredMenuItemComponent.prototype.onMouseLeave = function () {
17109
- window.clearTimeout(this._showTimeout);
17216
+ StepsComponent.prototype.afterBarAnimation = function (index, activeIndex) {
17217
+ var visited = index < activeIndex;
17218
+ var activated = index === activeIndex - 1;
17219
+ return visited || activated;
17110
17220
  };
17111
- TieredMenuItemComponent.ctorParameters = function () { return [
17112
- { type: TieredMenuEventService }
17113
- ]; };
17114
- __decorate([
17115
- core.Input()
17116
- ], TieredMenuItemComponent.prototype, "item", void 0);
17117
- __decorate([
17118
- core.Input()
17119
- ], TieredMenuItemComponent.prototype, "focused", void 0);
17221
+ Object.defineProperty(StepsComponent.prototype, "visibledStep", {
17222
+ get: function () {
17223
+ return this.steps.filter(function (step) { return !step.hidden; });
17224
+ },
17225
+ enumerable: true,
17226
+ configurable: true
17227
+ });
17228
+ var StepsComponent_1;
17229
+ StepsComponent.nextId = 0;
17120
17230
  __decorate([
17121
17231
  core.Input()
17122
- ], TieredMenuItemComponent.prototype, "highlight", void 0);
17232
+ ], StepsComponent.prototype, "id", void 0);
17123
17233
  __decorate([
17124
17234
  core.Input()
17125
- ], TieredMenuItemComponent.prototype, "triggerEvent", void 0);
17235
+ ], StepsComponent.prototype, "steps", void 0);
17126
17236
  __decorate([
17127
17237
  core.Input()
17128
- ], TieredMenuItemComponent.prototype, "closeOnClick", void 0);
17129
- __decorate([
17130
- core.HostListener("click"),
17131
- core.HostListener("touchend")
17132
- ], TieredMenuItemComponent.prototype, "onClick", null);
17133
- __decorate([
17134
- core.HostListener("mouseenter")
17135
- ], TieredMenuItemComponent.prototype, "onMouseEnter", null);
17238
+ ], StepsComponent.prototype, "activeIndex", void 0);
17136
17239
  __decorate([
17137
- core.HostListener("mouseleave")
17138
- ], TieredMenuItemComponent.prototype, "onMouseLeave", null);
17139
- TieredMenuItemComponent = __decorate([
17240
+ core.Output()
17241
+ ], StepsComponent.prototype, "stepSelected", void 0);
17242
+ StepsComponent = StepsComponent_1 = __decorate([
17140
17243
  core.Component({
17141
- selector: "s-tiered-menu-item",
17142
- 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>",
17143
- 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}"]
17244
+ selector: "s-steps",
17245
+ 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",
17246
+ host: {
17247
+ "aria-orientation": "horizontal",
17248
+ role: "tablist",
17249
+ "tab-index": "0",
17250
+ },
17251
+ animations: [
17252
+ animations.trigger("beforeActiveDesative", [
17253
+ animations.state("active", animations.style({
17254
+ "background-position": "left bottom",
17255
+ })),
17256
+ animations.state("desactive", animations.style({
17257
+ "background-position": "right bottom",
17258
+ })),
17259
+ animations.transition("active => desactive", [animations.animate("50ms 100ms linear")]),
17260
+ animations.transition("desactive => active", [animations.animate("50ms 250ms linear")]),
17261
+ ]),
17262
+ animations.trigger("activeDesative", [
17263
+ animations.state("active", animations.style({
17264
+ "background-position": "left bottom",
17265
+ })),
17266
+ animations.state("desactive", animations.style({
17267
+ "background-position": "right bottom",
17268
+ })),
17269
+ animations.transition("active => desactive", [animations.animate("100ms 150ms linear")]),
17270
+ animations.transition("desactive => active", [animations.animate("100ms 150ms linear")]),
17271
+ ]),
17272
+ animations.trigger("afterActiveDesative", [
17273
+ animations.state("active", animations.style({
17274
+ "background-position": "left bottom",
17275
+ })),
17276
+ animations.state("desactive", animations.style({
17277
+ "background-position": "right bottom",
17278
+ })),
17279
+ animations.transition("active => desactive", [animations.animate("50ms 250ms linear")]),
17280
+ animations.transition("desactive => active", [animations.animate("50ms 100ms linear")]),
17281
+ ]),
17282
+ ],
17283
+ 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}}"]
17144
17284
  })
17145
- ], TieredMenuItemComponent);
17146
- return TieredMenuItemComponent;
17285
+ ], StepsComponent);
17286
+ return StepsComponent;
17147
17287
  }());
17148
17288
 
17149
- var TieredMenuModule = /** @class */ (function () {
17150
- function TieredMenuModule() {
17289
+ var StepsModule = /** @class */ (function () {
17290
+ function StepsModule() {
17151
17291
  }
17152
- TieredMenuModule = __decorate([
17292
+ StepsModule = __decorate([
17153
17293
  core.NgModule({
17154
- imports: [
17155
- common.CommonModule,
17156
- ],
17157
- declarations: [
17158
- TieredMenuDirective,
17159
- TieredMenuComponent,
17160
- TieredMenuNestedComponent,
17161
- TieredMenuItemComponent,
17162
- TieredMenuDividerComponent,
17163
- ],
17164
- exports: [TieredMenuDirective],
17165
- providers: [TieredMenuGlobalService],
17294
+ imports: [common.CommonModule, tooltip.TooltipModule],
17295
+ declarations: [StepsComponent],
17296
+ exports: [StepsComponent],
17166
17297
  })
17167
- ], TieredMenuModule);
17168
- return TieredMenuModule;
17298
+ ], StepsModule);
17299
+ return StepsModule;
17169
17300
  }());
17170
17301
 
17171
17302
  var TileComponent = /** @class */ (function () {
@@ -18218,6 +18349,8 @@
18218
18349
  exports.MaskFormatterModule = MaskFormatterModule;
18219
18350
  exports.MaskFormatterPipe = MaskFormatterPipe;
18220
18351
  exports.MouseEventsModule = MouseEventsModule;
18352
+ exports.NavigationButtonComponent = NavigationButtonComponent;
18353
+ exports.NavigationButtonModule = NavigationButtonModule;
18221
18354
  exports.NavigationDirective = NavigationDirective;
18222
18355
  exports.NumberField = NumberField;
18223
18356
  exports.NumberInputDirective = NumberInputDirective;
@@ -18339,20 +18472,20 @@
18339
18472
  exports.ɵct = KanbanColumnComponent;
18340
18473
  exports.ɵcu = KanbanItemDraggingComponent;
18341
18474
  exports.ɵcv = NumberLocaleOptions;
18342
- exports.ɵcw = BorderButtonModule;
18343
- exports.ɵcx = BorderButtonComponent;
18344
- exports.ɵcy = ProgressBarDeterminateComponent;
18345
- exports.ɵcz = ProgressBarIndeterminateComponent;
18475
+ exports.ɵcw = TieredMenuEventService;
18476
+ exports.ɵcx = TieredMenuService;
18477
+ exports.ɵcy = TieredMenuGlobalService;
18478
+ exports.ɵcz = TieredMenuComponent;
18346
18479
  exports.ɵd = TemplateModule;
18347
- exports.ɵda = SelectButtonItemComponent;
18348
- exports.ɵdb = SlidePanelService;
18349
- exports.ɵdc = TieredMenuEventService;
18350
- exports.ɵdd = TieredMenuService;
18351
- exports.ɵde = TieredMenuGlobalService;
18352
- exports.ɵdf = TieredMenuComponent;
18353
- exports.ɵdg = TieredMenuNestedComponent;
18354
- exports.ɵdh = TieredMenuItemComponent;
18355
- exports.ɵdi = TieredMenuDividerComponent;
18480
+ exports.ɵda = TieredMenuNestedComponent;
18481
+ exports.ɵdb = TieredMenuItemComponent;
18482
+ exports.ɵdc = TieredMenuDividerComponent;
18483
+ exports.ɵdd = BorderButtonModule;
18484
+ exports.ɵde = BorderButtonComponent;
18485
+ exports.ɵdf = ProgressBarDeterminateComponent;
18486
+ exports.ɵdg = ProgressBarIndeterminateComponent;
18487
+ exports.ɵdh = SelectButtonItemComponent;
18488
+ exports.ɵdi = SlidePanelService;
18356
18489
  exports.ɵdj = TimelineItemModule;
18357
18490
  exports.ɵdk = TimelineIconItemComponent;
18358
18491
  exports.ɵdl = HorizontalTimelineModule;