@seniorsistemas/angular-components 16.11.2 → 16.12.1

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 (31) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +137 -13
  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/boolean-switch-field.d.ts +3 -0
  6. package/components/slide-bar/index.d.ts +2 -0
  7. package/components/slide-bar/slide-bar.component.d.ts +23 -0
  8. package/components/slide-bar/slide-bar.module.d.ts +2 -0
  9. package/esm2015/components/accordion/components/accordion-panel/accordion-panel.component.js +11 -12
  10. package/esm2015/components/control-errors/control-errors.component.js +4 -3
  11. package/esm2015/components/dynamic-form/components/fields/boolean/boolean-switch-field.component.js +2 -2
  12. package/esm2015/components/dynamic-form/configurations/fields/boolean-switch-field.js +5 -1
  13. package/esm2015/components/slide-bar/index.js +3 -0
  14. package/esm2015/components/slide-bar/slide-bar.component.js +105 -0
  15. package/esm2015/components/slide-bar/slide-bar.module.js +19 -0
  16. package/esm2015/public-api.js +2 -1
  17. package/esm5/components/accordion/components/accordion-panel/accordion-panel.component.js +11 -12
  18. package/esm5/components/control-errors/control-errors.component.js +4 -3
  19. package/esm5/components/dynamic-form/components/fields/boolean/boolean-switch-field.component.js +2 -2
  20. package/esm5/components/dynamic-form/configurations/fields/boolean-switch-field.js +5 -1
  21. package/esm5/components/slide-bar/index.js +3 -0
  22. package/esm5/components/slide-bar/slide-bar.component.js +107 -0
  23. package/esm5/components/slide-bar/slide-bar.module.js +22 -0
  24. package/esm5/public-api.js +2 -1
  25. package/fesm2015/seniorsistemas-angular-components.js +131 -14
  26. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  27. package/fesm5/seniorsistemas-angular-components.js +136 -14
  28. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  29. package/package.json +1 -1
  30. package/public-api.d.ts +1 -0
  31. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -288,17 +288,16 @@
288
288
  AccordionPanelComponent = __decorate([
289
289
  core.Component({
290
290
  selector: "s-accordion-panel",
291
- template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <p-inputSwitch\n *ngIf=\"switch\"\n class=\"switch\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"switchState\"\n (click)=\"$event.stopPropagation()\"\n (onChange)=\"switch.onChange($event)\">\n </p-inputSwitch>\n </div>\n </div>\n <ng-container *ngIf=\"cache; then thenBlock else elseBlock\"></ng-container>\n</div>\n\n<ng-template #thenBlock>\n <div\n class=\"content\"\n [hidden]=\"!isOpen\"\n @contentAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@contentAnimation.start)=\"onContentAnimationStart()\"\n (@contentAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n\n<ng-template #elseBlock>\n <div\n *ngIf=\"isOpen\"\n class=\"content\"\n @contentAnimation\n [@.disabled]=\"isContentAnimationDisabled\" \n (@contentAnimation.start)=\"onContentAnimationStart()\"\n (@contentAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>",
291
+ template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <p-inputSwitch\n *ngIf=\"switch\"\n class=\"switch\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"switchState\"\n (click)=\"$event.stopPropagation()\"\n (onChange)=\"switch.onChange($event)\">\n </p-inputSwitch>\n </div>\n </div>\n <ng-container *ngIf=\"cache; then cacheTemplate else cachelessTemplate\"></ng-container>\n</div>\n\n<ng-template #cacheTemplate>\n <div\n class=\"content\"\n [@cacheAnimation]=\"isOpen\"\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cacheAnimation.start)=\"onContentAnimationStart()\"\n (@cacheAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #cachelessTemplate>\n <div\n *ngIf=\"isOpen\"\n class=\"content\"\n @cachelessAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cachelessAnimation.start)=\"onContentAnimationStart()\"\n (@cachelessAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #panelContent>\n <ng-content></ng-content>\n</ng-template>",
292
292
  animations: [
293
- animations.trigger("contentAnimation", [
294
- animations.transition(":enter", [
295
- animations.style({ height: "0" }),
296
- animations.animate("200ms linear", animations.style({ height: "*" })),
297
- ]),
298
- animations.transition(":leave", [
299
- animations.style({ height: "*" }),
300
- animations.animate("200ms linear", animations.style({ height: "0" })),
301
- ]),
293
+ animations.trigger("cachelessAnimation", [
294
+ animations.transition(":enter", [animations.style({ height: "0" }), animations.animate("200ms linear", animations.style({ height: "*" }))]),
295
+ animations.transition(":leave", [animations.style({ height: "*" }), animations.animate("200ms linear", animations.style({ height: "0" }))]),
296
+ ]),
297
+ animations.trigger("cacheAnimation", [
298
+ animations.state("true", animations.style({ height: "*" })),
299
+ animations.state("false", animations.style({ height: '0px' })),
300
+ animations.transition("* => *", animations.animate("200ms")),
302
301
  ]),
303
302
  ],
304
303
  styles: [".accordion-panel{border-bottom:1px solid #c1c1cc}.accordion-panel .header{-ms-flex-align:center;align-items:center;background-color:#fff;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:16px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.accordion-panel .header .header__title{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.accordion-panel .header .header__title .icon{color:#212533;font-size:1rem;margin-right:12px}.accordion-panel .header .header__title .exclamation-icon{color:#c13018;font-size:1rem;margin-right:12px}.accordion-panel .header .header__title .title{font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:700;line-height:150%;text-transform:uppercase}.accordion-panel .header .header__controls{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;margin-left:16px}.accordion-panel .header .header__controls .icon-button{color:#212533;cursor:pointer;font-size:1rem;margin-left:16px;border:none;background:0 0}.accordion-panel .header .header__controls .switch{padding-left:16px}.accordion-panel .content{background-color:#fff;overflow:hidden}.accordion-panel .content .content-container{margin:20px}.accordion-panel--open .header{background-color:#eeebf2;border-bottom:1px solid #c1c1cc}.accordion-panel--disabled .header{cursor:auto}.accordion-panel--disabled .header .header__title .icon,.accordion-panel--disabled .header .header__title .title{color:#c1c1cc}.accordion-panel--disabled .header .header__controls .icon-button{color:#c1c1cc;cursor:auto}"]
@@ -1810,9 +1809,10 @@
1810
1809
  ControlErrorsComponent_1 = ControlErrorsComponent;
1811
1810
  ControlErrorsComponent.prototype.getErrorMessagesList = function () {
1812
1811
  var _this = this;
1813
- if (!this.control || !this.control.dirty)
1812
+ if (!this.control || !this.control.dirty) {
1814
1813
  return [];
1815
- return Object.keys(this.control.errors || {}).map(function (error) { return _this.errorMessages[error]; });
1814
+ }
1815
+ return Object.keys(this.control.errors || {}).map(function (error) { var _a; return (_a = _this.errorMessages) === null || _a === void 0 ? void 0 : _a[error]; });
1816
1816
  };
1817
1817
  var ControlErrorsComponent_1;
1818
1818
  ControlErrorsComponent.nextId = 0;
@@ -2952,6 +2952,9 @@
2952
2952
  function BooleanSwitchField(config) {
2953
2953
  var _this = _super.call(this, config) || this;
2954
2954
  _this.onChange = config.onChange;
2955
+ if (config.optionsLabel) {
2956
+ _this.optionsLabel = new BooleanOptionsLabel(config.optionsLabel);
2957
+ }
2955
2958
  _this.representedBy = "switch";
2956
2959
  return _this;
2957
2960
  }
@@ -7138,7 +7141,7 @@
7138
7141
  ], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
7139
7142
  BooleanSwitchFieldComponent = __decorate([
7140
7143
  core.Component({
7141
- template: "<div class=\"ui-g\">\n <p-inputSwitch\n [id]=\"(field.id || field.name)\"\n [name]=\"field.name\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n </p-inputSwitch>\n</div>"
7144
+ template: "<div class=\"ui-grid ui-grid-responsive ui-grid-pad ui-fluid\">\n <div class=\"ui-grid-row\">\n <div class=\"i-grid-col-1\">\n <p-inputSwitch [id]=\"(field.id || field.name)\" [name]=\"field.name\" [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\" tooltipPosition=\"top\"\n (onChange)=\"field.onChange ? field.onChange($event) : null\">\n </p-inputSwitch>\n </div>\n <div class=\"i-grid-col-1\" *ngIf=\"field.optionsLabel\">\n <ng-container *ngIf=\"formControl.value; else caseFalse\">\n <span>{{ field.optionsLabel.true }}</span>\n </ng-container>\n <ng-template #caseFalse>\n <span>{{ field.optionsLabel.false }}</span>\n </ng-template>\n </div>\n </div>\n</div>"
7142
7145
  })
7143
7146
  ], BooleanSwitchFieldComponent);
7144
7147
  return BooleanSwitchFieldComponent;
@@ -9688,6 +9691,125 @@
9688
9691
  return SidebarModule;
9689
9692
  }());
9690
9693
 
9694
+ var SMALL_DEVICE_BREAKPOINT = 420;
9695
+ var SlideBarComponent = /** @class */ (function () {
9696
+ function SlideBarComponent() {
9697
+ this.openIcon = "fas fa-chevron-right";
9698
+ this.closeIcon = "fas fa-chevron-left";
9699
+ this.cache = false;
9700
+ this.barOpened = new core.EventEmitter();
9701
+ this.barClosed = new core.EventEmitter();
9702
+ this.slideHeight = 0;
9703
+ this.isOpen = false;
9704
+ this.isSlideOver = false;
9705
+ this.isAnimating = false;
9706
+ this.isContentAnimationDisabled = true;
9707
+ }
9708
+ SlideBarComponent.prototype.onResize = function () {
9709
+ this._checkOverBehavior();
9710
+ };
9711
+ SlideBarComponent.prototype.ngOnInit = function () {
9712
+ this._checkOverBehavior();
9713
+ };
9714
+ SlideBarComponent.prototype.ngAfterViewChecked = function () {
9715
+ var _this = this;
9716
+ // to executed at a safe time prior to control returning to the browser's event loop
9717
+ queueMicrotask(function () {
9718
+ _this._calculateSlideHeight();
9719
+ _this.isContentAnimationDisabled = false;
9720
+ });
9721
+ };
9722
+ SlideBarComponent.prototype.onClickButton = function () {
9723
+ if (this.isAnimating) {
9724
+ return;
9725
+ }
9726
+ this.isOpen = !this.isOpen;
9727
+ if (this.isOpen) {
9728
+ this.barOpened.emit();
9729
+ }
9730
+ else {
9731
+ this.barClosed.emit();
9732
+ }
9733
+ };
9734
+ SlideBarComponent.prototype.onContentAnimationStart = function () {
9735
+ this.isAnimating = true;
9736
+ };
9737
+ SlideBarComponent.prototype.onContentAnimationDone = function () {
9738
+ this.isAnimating = false;
9739
+ };
9740
+ SlideBarComponent.prototype._checkOverBehavior = function () {
9741
+ this.isSlideOver = window.innerWidth <= SMALL_DEVICE_BREAKPOINT;
9742
+ };
9743
+ SlideBarComponent.prototype._calculateSlideHeight = function () {
9744
+ this.slideHeight = this.sideContent.nativeElement.clientHeight;
9745
+ };
9746
+ __decorate([
9747
+ core.Input()
9748
+ ], SlideBarComponent.prototype, "openIcon", void 0);
9749
+ __decorate([
9750
+ core.Input()
9751
+ ], SlideBarComponent.prototype, "closeIcon", void 0);
9752
+ __decorate([
9753
+ core.Input()
9754
+ ], SlideBarComponent.prototype, "cache", void 0);
9755
+ __decorate([
9756
+ core.Output()
9757
+ ], SlideBarComponent.prototype, "barOpened", void 0);
9758
+ __decorate([
9759
+ core.Output()
9760
+ ], SlideBarComponent.prototype, "barClosed", void 0);
9761
+ __decorate([
9762
+ core.ViewChild("mainContainer")
9763
+ ], SlideBarComponent.prototype, "mainContainer", void 0);
9764
+ __decorate([
9765
+ core.ViewChild("sideContent")
9766
+ ], SlideBarComponent.prototype, "sideContent", void 0);
9767
+ __decorate([
9768
+ core.HostListener("window:resize")
9769
+ ], SlideBarComponent.prototype, "onResize", null);
9770
+ SlideBarComponent = __decorate([
9771
+ core.Component({
9772
+ selector: "s-slide-bar",
9773
+ template: "<div class=\"slide-bar\">\n <div\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 #sideContent class=\"side-content\">\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]=\"slideContent\"></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]=\"slideContent\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #slideContent>\n <ng-content select=\"[slide-content]\"></ng-content>\n</ng-template>",
9774
+ animations: [
9775
+ animations.trigger("cachelessAnimation", [
9776
+ animations.transition(":enter", [
9777
+ animations.style({ width: "0" }),
9778
+ animations.animate("200ms linear", animations.style({ width: "*" })),
9779
+ ]),
9780
+ animations.transition(":leave", [
9781
+ animations.style({ width: "*" }),
9782
+ animations.animate("200ms linear", animations.style({ width: "0" })),
9783
+ ]),
9784
+ ]),
9785
+ animations.trigger("cacheAnimation", [
9786
+ animations.state("true", animations.style({ width: "*", padding: '0 16px' })),
9787
+ animations.state("false", animations.style({ width: '0px', padding: '0' })),
9788
+ animations.transition("* => *", animations.animate("200ms")),
9789
+ ]),
9790
+ ],
9791
+ styles: [".slide-bar{display:-ms-flexbox;display:flex}.slide-bar .slide-content{display:-ms-flexbox;display:flex;position:relative}.slide-bar .slide-content .main-container{background-color:#eeebf2;display:-ms-flexbox;display:flex;border:1px solid #ccc;overflow:hidden;position:relative}.slide-bar .slide-content .main-container .content-container{overflow-y:auto;overflow-x:hidden;padding:16px}.slide-bar .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-size:16px;height:32px;-ms-flex-pack:center;justify-content:center;position:absolute;right:-32px;top:16px;width:32px}.slide-bar .slide-content--closed .main-container{border:none}.slide-bar .slide-content--over{position:absolute}.slide-bar .side-content{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;height:-webkit-max-content;height:max-content}"]
9792
+ })
9793
+ ], SlideBarComponent);
9794
+ return SlideBarComponent;
9795
+ }());
9796
+
9797
+ var SlideBarModule = /** @class */ (function () {
9798
+ function SlideBarModule() {
9799
+ }
9800
+ SlideBarModule = __decorate([
9801
+ core.NgModule({
9802
+ imports: [
9803
+ common.CommonModule,
9804
+ animations$1.BrowserAnimationsModule,
9805
+ ],
9806
+ declarations: [SlideBarComponent],
9807
+ exports: [SlideBarComponent],
9808
+ })
9809
+ ], SlideBarModule);
9810
+ return SlideBarModule;
9811
+ }());
9812
+
9691
9813
  var StatsCardComponent = /** @class */ (function () {
9692
9814
  function StatsCardComponent() {
9693
9815
  this.id = "s-stats-card-" + StatsCardComponent_1.nextId++;
@@ -12901,6 +13023,8 @@
12901
13023
  exports.SelectOption = SelectOption;
12902
13024
  exports.SidebarComponent = SidebarComponent;
12903
13025
  exports.SidebarModule = SidebarModule;
13026
+ exports.SlideBarComponent = SlideBarComponent;
13027
+ exports.SlideBarModule = SlideBarModule;
12904
13028
  exports.SplitButtonComponent = SplitButtonComponent;
12905
13029
  exports.SplitButtonModule = SplitButtonModule;
12906
13030
  exports.StatsCardComponent = StatsCardComponent;