@seniorsistemas/angular-components 16.12.2 → 16.12.4

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 (33) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +102 -69
  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/custom-fields/custom-fields.component.d.ts +9 -4
  6. package/components/slide-panel/index.d.ts +2 -0
  7. package/components/{slide-bar/slide-bar.component.d.ts → slide-panel/slide-panel.component.d.ts} +3 -3
  8. package/components/slide-panel/slide-panel.module.d.ts +2 -0
  9. package/esm2015/components/custom-fields/custom-fields.component.js +54 -32
  10. package/esm2015/components/slide-panel/index.js +3 -0
  11. package/esm2015/components/slide-panel/slide-panel.component.js +105 -0
  12. package/esm2015/components/slide-panel/slide-panel.module.js +19 -0
  13. package/esm2015/public-api.js +2 -2
  14. package/esm5/components/custom-fields/custom-fields.component.js +67 -34
  15. package/esm5/components/slide-panel/index.js +3 -0
  16. package/esm5/components/slide-panel/slide-panel.component.js +107 -0
  17. package/esm5/components/slide-panel/slide-panel.module.js +22 -0
  18. package/esm5/public-api.js +2 -2
  19. package/fesm2015/seniorsistemas-angular-components.js +77 -55
  20. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  21. package/fesm5/seniorsistemas-angular-components.js +101 -68
  22. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  23. package/package.json +1 -1
  24. package/public-api.d.ts +1 -1
  25. package/seniorsistemas-angular-components.metadata.json +1 -1
  26. package/components/slide-bar/index.d.ts +0 -2
  27. package/components/slide-bar/slide-bar.module.d.ts +0 -2
  28. package/esm2015/components/slide-bar/index.js +0 -3
  29. package/esm2015/components/slide-bar/slide-bar.component.js +0 -105
  30. package/esm2015/components/slide-bar/slide-bar.module.js +0 -19
  31. package/esm5/components/slide-bar/index.js +0 -3
  32. package/esm5/components/slide-bar/slide-bar.component.js +0 -107
  33. package/esm5/components/slide-bar/slide-bar.module.js +0 -22
@@ -8109,38 +8109,6 @@
8109
8109
  enumerable: true,
8110
8110
  configurable: true
8111
8111
  });
8112
- CustomFieldsComponent.prototype.registerOnChange = function (fn) {
8113
- var _this = this;
8114
- this.onChange = fn;
8115
- this.formGroup.valueChanges.subscribe(function () { return _this.onChange(_this.parseFieldsValues()); });
8116
- };
8117
- CustomFieldsComponent.prototype.registerOnTouched = function (fn) {
8118
- this.onTouched = fn;
8119
- };
8120
- CustomFieldsComponent.prototype.writeValue = function (value) {
8121
- if (this.ready) {
8122
- var newValue = this.parseValuesForFields(value);
8123
- this.formGroup.patchValue(newValue);
8124
- this.value = newValue;
8125
- this.createFilesIfSetFormValuesAfterInit();
8126
- }
8127
- else {
8128
- this.formGroup.patchValue(value || {});
8129
- this.value = value;
8130
- }
8131
- };
8132
- CustomFieldsComponent.prototype.setDisabledState = function (isDisabled) {
8133
- if (isDisabled)
8134
- this.formGroup.disable({ emitEvent: false });
8135
- else
8136
- this.formGroup.enable({ emitEvent: false });
8137
- };
8138
- CustomFieldsComponent.prototype.getCustomFields = function () {
8139
- if (this.entityObject && this.entityObject.entity_) {
8140
- return rxjs.of(this.entityObject);
8141
- }
8142
- return this.customFieldsService.getCustomFields(this.domain, this.service, this.entity, this.customFieldsEndpoint);
8143
- };
8144
8112
  CustomFieldsComponent.prototype.ngOnInit = function () {
8145
8113
  var _this = this;
8146
8114
  if (!this.domain)
@@ -8213,10 +8181,50 @@
8213
8181
  _this.ready = true;
8214
8182
  });
8215
8183
  };
8184
+ CustomFieldsComponent.prototype.ngAfterViewInit = function () {
8185
+ this.enableOrDisableFields(this.disableFields);
8186
+ };
8187
+ CustomFieldsComponent.prototype.ngOnChanges = function (changes) {
8188
+ if (changes.disableFields) {
8189
+ this.enableOrDisableFields(changes.disableFields.currentValue);
8190
+ }
8191
+ };
8216
8192
  CustomFieldsComponent.prototype.ngOnDestroy = function () {
8217
8193
  this.ngUsubscribe.next();
8218
8194
  this.ngUsubscribe.complete();
8219
8195
  };
8196
+ CustomFieldsComponent.prototype.registerOnChange = function (fn) {
8197
+ var _this = this;
8198
+ this.onChange = fn;
8199
+ this.formGroup.valueChanges.subscribe(function () { return _this.onChange(_this.parseFieldsValues()); });
8200
+ };
8201
+ CustomFieldsComponent.prototype.registerOnTouched = function (fn) {
8202
+ this.onTouched = fn;
8203
+ };
8204
+ CustomFieldsComponent.prototype.writeValue = function (value) {
8205
+ if (this.ready) {
8206
+ var newValue = this.parseValuesForFields(value);
8207
+ this.formGroup.patchValue(newValue);
8208
+ this.value = newValue;
8209
+ this.createFilesIfSetFormValuesAfterInit();
8210
+ }
8211
+ else {
8212
+ this.formGroup.patchValue(value || {});
8213
+ this.value = value;
8214
+ }
8215
+ };
8216
+ CustomFieldsComponent.prototype.setDisabledState = function (isDisabled) {
8217
+ if (isDisabled)
8218
+ this.formGroup.disable({ emitEvent: false });
8219
+ else
8220
+ this.formGroup.enable({ emitEvent: false });
8221
+ };
8222
+ CustomFieldsComponent.prototype.getCustomFields = function () {
8223
+ if (this.entityObject && this.entityObject.entity_) {
8224
+ return rxjs.of(this.entityObject);
8225
+ }
8226
+ return this.customFieldsService.getCustomFields(this.domain, this.service, this.entity, this.customFieldsEndpoint);
8227
+ };
8220
8228
  CustomFieldsComponent.prototype.validate = function () {
8221
8229
  var _this = this;
8222
8230
  var errors = {};
@@ -8227,6 +8235,28 @@
8227
8235
  });
8228
8236
  return errors;
8229
8237
  };
8238
+ CustomFieldsComponent.prototype.enableOrDisableFields = function (disabled) {
8239
+ var e_1, _a;
8240
+ if (!this.formGroup) {
8241
+ return;
8242
+ }
8243
+ try {
8244
+ for (var _b = __values(Object.keys(this.formGroup.value)), _c = _b.next(); !_c.done; _c = _b.next()) {
8245
+ var controlName = _c.value;
8246
+ disabled ? this.formGroup.get(controlName).disable() : this.formGroup.get(controlName).enable();
8247
+ }
8248
+ }
8249
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
8250
+ finally {
8251
+ try {
8252
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
8253
+ }
8254
+ finally { if (e_1) throw e_1.error; }
8255
+ }
8256
+ };
8257
+ CustomFieldsComponent.prototype.cleanFields = function () {
8258
+ this.formGroup.reset();
8259
+ };
8230
8260
  CustomFieldsComponent.prototype.parseValuesForFields = function (values) {
8231
8261
  var parsedValues = __assign({}, values);
8232
8262
  this.fields.forEach(function (field) {
@@ -8614,6 +8644,9 @@
8614
8644
  __decorate([
8615
8645
  core.Input()
8616
8646
  ], CustomFieldsComponent.prototype, "ready$", void 0);
8647
+ __decorate([
8648
+ core.Input()
8649
+ ], CustomFieldsComponent.prototype, "disableFields", void 0);
8617
8650
  CustomFieldsComponent = CustomFieldsComponent_1 = __decorate([
8618
8651
  core.Component({
8619
8652
  selector: "s-custom-fields",
@@ -9665,26 +9698,26 @@
9665
9698
  }());
9666
9699
 
9667
9700
  var SMALL_DEVICE_BREAKPOINT = 420;
9668
- var SlideBarComponent = /** @class */ (function () {
9669
- function SlideBarComponent() {
9701
+ var SlidePanelComponent = /** @class */ (function () {
9702
+ function SlidePanelComponent() {
9670
9703
  this.openIcon = "fas fa-chevron-right";
9671
9704
  this.closeIcon = "fas fa-chevron-left";
9672
9705
  this.cache = false;
9673
- this.barOpened = new core.EventEmitter();
9674
- this.barClosed = new core.EventEmitter();
9706
+ this.panelOpened = new core.EventEmitter();
9707
+ this.panelClosed = new core.EventEmitter();
9675
9708
  this.slideHeight = 0;
9676
9709
  this.isOpen = false;
9677
9710
  this.isSlideOver = false;
9678
9711
  this.isAnimating = false;
9679
9712
  this.isContentAnimationDisabled = true;
9680
9713
  }
9681
- SlideBarComponent.prototype.onResize = function () {
9714
+ SlidePanelComponent.prototype.onResize = function () {
9682
9715
  this._checkOverBehavior();
9683
9716
  };
9684
- SlideBarComponent.prototype.ngOnInit = function () {
9717
+ SlidePanelComponent.prototype.ngOnInit = function () {
9685
9718
  this._checkOverBehavior();
9686
9719
  };
9687
- SlideBarComponent.prototype.ngAfterViewChecked = function () {
9720
+ SlidePanelComponent.prototype.ngAfterViewChecked = function () {
9688
9721
  var _this = this;
9689
9722
  // to executed at a safe time prior to control returning to the browser's event loop
9690
9723
  queueMicrotask(function () {
@@ -9692,58 +9725,58 @@
9692
9725
  _this.isContentAnimationDisabled = false;
9693
9726
  });
9694
9727
  };
9695
- SlideBarComponent.prototype.onClickButton = function () {
9728
+ SlidePanelComponent.prototype.onClickButton = function () {
9696
9729
  if (this.isAnimating) {
9697
9730
  return;
9698
9731
  }
9699
9732
  this.isOpen = !this.isOpen;
9700
9733
  if (this.isOpen) {
9701
- this.barOpened.emit();
9734
+ this.panelOpened.emit();
9702
9735
  }
9703
9736
  else {
9704
- this.barClosed.emit();
9737
+ this.panelClosed.emit();
9705
9738
  }
9706
9739
  };
9707
- SlideBarComponent.prototype.onContentAnimationStart = function () {
9740
+ SlidePanelComponent.prototype.onContentAnimationStart = function () {
9708
9741
  this.isAnimating = true;
9709
9742
  };
9710
- SlideBarComponent.prototype.onContentAnimationDone = function () {
9743
+ SlidePanelComponent.prototype.onContentAnimationDone = function () {
9711
9744
  this.isAnimating = false;
9712
9745
  };
9713
- SlideBarComponent.prototype._checkOverBehavior = function () {
9746
+ SlidePanelComponent.prototype._checkOverBehavior = function () {
9714
9747
  this.isSlideOver = window.innerWidth <= SMALL_DEVICE_BREAKPOINT;
9715
9748
  };
9716
- SlideBarComponent.prototype._calculateSlideHeight = function () {
9749
+ SlidePanelComponent.prototype._calculateSlideHeight = function () {
9717
9750
  this.slideHeight = this.sideContent.nativeElement.clientHeight;
9718
9751
  };
9719
9752
  __decorate([
9720
9753
  core.Input()
9721
- ], SlideBarComponent.prototype, "openIcon", void 0);
9754
+ ], SlidePanelComponent.prototype, "openIcon", void 0);
9722
9755
  __decorate([
9723
9756
  core.Input()
9724
- ], SlideBarComponent.prototype, "closeIcon", void 0);
9757
+ ], SlidePanelComponent.prototype, "closeIcon", void 0);
9725
9758
  __decorate([
9726
9759
  core.Input()
9727
- ], SlideBarComponent.prototype, "cache", void 0);
9760
+ ], SlidePanelComponent.prototype, "cache", void 0);
9728
9761
  __decorate([
9729
9762
  core.Output()
9730
- ], SlideBarComponent.prototype, "barOpened", void 0);
9763
+ ], SlidePanelComponent.prototype, "panelOpened", void 0);
9731
9764
  __decorate([
9732
9765
  core.Output()
9733
- ], SlideBarComponent.prototype, "barClosed", void 0);
9766
+ ], SlidePanelComponent.prototype, "panelClosed", void 0);
9734
9767
  __decorate([
9735
9768
  core.ViewChild("mainContainer")
9736
- ], SlideBarComponent.prototype, "mainContainer", void 0);
9769
+ ], SlidePanelComponent.prototype, "mainContainer", void 0);
9737
9770
  __decorate([
9738
9771
  core.ViewChild("sideContent")
9739
- ], SlideBarComponent.prototype, "sideContent", void 0);
9772
+ ], SlidePanelComponent.prototype, "sideContent", void 0);
9740
9773
  __decorate([
9741
9774
  core.HostListener("window:resize")
9742
- ], SlideBarComponent.prototype, "onResize", null);
9743
- SlideBarComponent = __decorate([
9775
+ ], SlidePanelComponent.prototype, "onResize", null);
9776
+ SlidePanelComponent = __decorate([
9744
9777
  core.Component({
9745
- selector: "s-slide-bar",
9746
- 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>",
9778
+ selector: "s-slide-panel",
9779
+ template: "<div class=\"slide-panel\">\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>",
9747
9780
  animations: [
9748
9781
  animations.trigger("cachelessAnimation", [
9749
9782
  animations.transition(":enter", [
@@ -9761,26 +9794,26 @@
9761
9794
  animations.transition("* => *", animations.animate("200ms")),
9762
9795
  ]),
9763
9796
  ],
9764
- 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}"]
9797
+ styles: [".slide-panel{display:-ms-flexbox;display:flex}.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-size:16px;height:32px;-ms-flex-pack:center;justify-content:center;position:absolute;right:-32px;top:16px;width:32px}.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;-ms-flex-positive:1;flex-grow:1;height:-webkit-max-content;height:max-content}"]
9765
9798
  })
9766
- ], SlideBarComponent);
9767
- return SlideBarComponent;
9799
+ ], SlidePanelComponent);
9800
+ return SlidePanelComponent;
9768
9801
  }());
9769
9802
 
9770
- var SlideBarModule = /** @class */ (function () {
9771
- function SlideBarModule() {
9803
+ var SlidePanelModule = /** @class */ (function () {
9804
+ function SlidePanelModule() {
9772
9805
  }
9773
- SlideBarModule = __decorate([
9806
+ SlidePanelModule = __decorate([
9774
9807
  core.NgModule({
9775
9808
  imports: [
9776
9809
  common.CommonModule,
9777
9810
  animations$1.BrowserAnimationsModule,
9778
9811
  ],
9779
- declarations: [SlideBarComponent],
9780
- exports: [SlideBarComponent],
9812
+ declarations: [SlidePanelComponent],
9813
+ exports: [SlidePanelComponent],
9781
9814
  })
9782
- ], SlideBarModule);
9783
- return SlideBarModule;
9815
+ ], SlidePanelModule);
9816
+ return SlidePanelModule;
9784
9817
  }());
9785
9818
 
9786
9819
  var StatsCardComponent = /** @class */ (function () {
@@ -12996,8 +13029,8 @@
12996
13029
  exports.SelectOption = SelectOption;
12997
13030
  exports.SidebarComponent = SidebarComponent;
12998
13031
  exports.SidebarModule = SidebarModule;
12999
- exports.SlideBarComponent = SlideBarComponent;
13000
- exports.SlideBarModule = SlideBarModule;
13032
+ exports.SlidePanelComponent = SlidePanelComponent;
13033
+ exports.SlidePanelModule = SlidePanelModule;
13001
13034
  exports.SplitButtonComponent = SplitButtonComponent;
13002
13035
  exports.SplitButtonModule = SplitButtonModule;
13003
13036
  exports.StatsCardComponent = StatsCardComponent;