@seniorsistemas/angular-components 17.8.7 → 17.8.8

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 (22) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +19 -17
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/profile-picture-picker/models/profile-picture-picker-data.d.ts +1 -1
  6. package/components/profile-picture-picker/profile-picture-picker.component.d.ts +4 -3
  7. package/esm2015/components/dynamic-form/components/fields/profile-picture/profile-picture-field.component.js +2 -2
  8. package/esm2015/components/password-strength/password-strength.directive.js +1 -4
  9. package/esm2015/components/profile-picture-picker/index.js +1 -1
  10. package/esm2015/components/profile-picture-picker/models/profile-picture-picker-data.js +1 -1
  11. package/esm2015/components/profile-picture-picker/profile-picture-picker.component.js +19 -14
  12. package/esm5/components/dynamic-form/components/fields/profile-picture/profile-picture-field.component.js +2 -2
  13. package/esm5/components/password-strength/password-strength.directive.js +1 -4
  14. package/esm5/components/profile-picture-picker/index.js +1 -1
  15. package/esm5/components/profile-picture-picker/models/profile-picture-picker-data.js +1 -1
  16. package/esm5/components/profile-picture-picker/profile-picture-picker.component.js +19 -14
  17. package/fesm2015/seniorsistemas-angular-components.js +19 -17
  18. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  19. package/fesm5/seniorsistemas-angular-components.js +19 -17
  20. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  21. package/package.json +1 -1
  22. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -7643,9 +7643,6 @@ var PasswordStrengthDirective = /** @class */ (function () {
7643
7643
  };
7644
7644
  PasswordStrengthDirective.prototype.validateProperties = function () {
7645
7645
  this.validation = this.validation || this.defaultValidator;
7646
- if (!this.description) {
7647
- throw new Error("Description is required");
7648
- }
7649
7646
  };
7650
7647
  PasswordStrengthDirective.prototype.destroyPasswordStrength = function () {
7651
7648
  if (this.componentRef !== null) {
@@ -9870,7 +9867,7 @@ var ProfilePictureFieldComponent = /** @class */ (function () {
9870
9867
  ], ProfilePictureFieldComponent.prototype, "formControl", void 0);
9871
9868
  ProfilePictureFieldComponent = __decorate([
9872
9869
  Component({
9873
- template: "<s-profile-picture-picker\n [formControl]=\"formControl\"\n [simpleTitle]=\"field.simpleTitle\"\n [actionTitle]=\"field.actionTitle\"\n [subtitle]=\"field.subtitle\"\n [aspectRatio]=\"field.aspectRatio\"\n [cropperLabelsConfig]=\"field.cropperLabelsConfig\"\n [removeButtonLabel]=\"field.removeButtonLabel\"\n [changeButtonLabel]=\"field.changeButtonLabel\"\n [confirmationTexts]=\"field.confirmationTexts\"\n [maxFileSize]=\"field.maxFileSize\"\n [accept]=\"field\"\n [supportedExtensions]=\"field.supportedExtensions\"\n (changedImage)=\"field.onChangeImage ? field.onChangeImage($event) : null\"\n (removedImage)=\"field.onRemovedImage ? field.onRemovedImage() : null\"\n (invalidFile)=\"field.onInvalidFile ? field.onInvalidFile($event) : null\">\n</s-profile-picture-picker>"
9870
+ template: "<s-profile-picture-picker\n [formControl]=\"formControl\"\n [simpleTitle]=\"field.simpleTitle\"\n [actionTitle]=\"field.actionTitle\"\n [subtitle]=\"field.subtitle\"\n [aspectRatio]=\"field.aspectRatio\"\n [cropperLabelsConfig]=\"field.cropperLabelsConfig\"\n [removeButtonLabel]=\"field.removeButtonLabel\"\n [changeButtonLabel]=\"field.changeButtonLabel\"\n [confirmationTexts]=\"field.confirmationTexts\"\n [maxFileSize]=\"field.maxFileSize\"\n [accept]=\"field.accept\"\n [supportedExtensions]=\"field.supportedExtensions\"\n (changedImage)=\"field.onChangeImage ? field.onChangeImage($event) : null\"\n (removedImage)=\"field.onRemovedImage ? field.onRemovedImage() : null\"\n (invalidFile)=\"field.onInvalidFile ? field.onInvalidFile($event) : null\">\n</s-profile-picture-picker>"
9874
9871
  })
9875
9872
  ], ProfilePictureFieldComponent);
9876
9873
  return ProfilePictureFieldComponent;
@@ -10780,13 +10777,8 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
10780
10777
  this.confirmationService = confirmationService;
10781
10778
  this.translateService = translateService;
10782
10779
  this.aspectRatio = 1;
10783
- this.confirmationTexts = {
10784
- removalHeader: this.translateService.instant("platform.angular_components.remove_image"),
10785
- removalMessage: this.translateService.instant("platform.angular_components.confirmation_remove_image"),
10786
- removalAcceptLabel: this.translateService.instant("platform.angular_components.remove"),
10787
- removalRejectLabel: this.translateService.instant("platform.angular_components.cancel"),
10788
- };
10789
10780
  this.supportedExtensions = [];
10781
+ this.imageChange = new EventEmitter();
10790
10782
  this.changedImage = new EventEmitter();
10791
10783
  this.removedImage = new EventEmitter();
10792
10784
  this.invalidFile = new EventEmitter();
@@ -10794,6 +10786,9 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
10794
10786
  ProfilePicturePickerComponent_1 = ProfilePicturePickerComponent;
10795
10787
  ProfilePicturePickerComponent.prototype.writeValue = function (value) {
10796
10788
  this._value = value;
10789
+ if (value) {
10790
+ this.image = value.base64;
10791
+ }
10797
10792
  };
10798
10793
  ProfilePicturePickerComponent.prototype.registerOnChange = function (onChange) {
10799
10794
  this._onChange = onChange;
@@ -10847,15 +10842,17 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
10847
10842
  };
10848
10843
  ProfilePicturePickerComponent.prototype.removePhoto = function () {
10849
10844
  var _this = this;
10845
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10850
10846
  this.confirmationService.confirm({
10851
- message: this.confirmationTexts.removalMessage,
10852
- acceptLabel: this.confirmationTexts.removalAcceptLabel,
10853
- rejectLabel: this.confirmationTexts.removalRejectLabel,
10854
- header: this.confirmationTexts.removalHeader,
10847
+ message: (_b = (_a = this.confirmationTexts) === null || _a === void 0 ? void 0 : _a.removalMessage) !== null && _b !== void 0 ? _b : this.translateService.instant("platform.angular_components.confirmation_remove_image"),
10848
+ acceptLabel: (_d = (_c = this.confirmationTexts) === null || _c === void 0 ? void 0 : _c.removalAcceptLabel) !== null && _d !== void 0 ? _d : this.translateService.instant("platform.angular_components.remove"),
10849
+ rejectLabel: (_f = (_e = this.confirmationTexts) === null || _e === void 0 ? void 0 : _e.removalRejectLabel) !== null && _f !== void 0 ? _f : this.translateService.instant("platform.angular_components.cancel"),
10850
+ header: (_h = (_g = this.confirmationTexts) === null || _g === void 0 ? void 0 : _g.removalHeader) !== null && _h !== void 0 ? _h : this.translateService.instant("platform.angular_components.remove_image"),
10851
+ rejectButtonStyleClass: "ui-button-secondary",
10855
10852
  accept: function () {
10856
10853
  var fileInputElement = _this.fileInput.nativeElement;
10857
10854
  fileInputElement.value = "";
10858
- _this.image = "";
10855
+ _this.image = null;
10859
10856
  _this.removedImage.emit();
10860
10857
  },
10861
10858
  });
@@ -10874,9 +10871,11 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
10874
10871
  fileReader.onloadend = function (fileEvent) {
10875
10872
  _this.imageCropperService.show(__assign({ imageSource: fileEvent.target.result, croppedImage: function (image) {
10876
10873
  var _a;
10874
+ var data = { source: file, base64: image };
10877
10875
  _this.image = image;
10876
+ _this.imageChange.emit(data);
10878
10877
  _this.changedImage.emit(image);
10879
- _this._value = { sourceFile: file, base64: image };
10878
+ _this._value = { source: file, base64: image };
10880
10879
  (_a = _this._onChange) === null || _a === void 0 ? void 0 : _a.call(_this, _this._value);
10881
10880
  }, changeImage: function () { return _this.selectPhoto(); }, allowSelectAnother: false, aspectRatio: _this.aspectRatio }, _this.cropperLabelsConfig));
10882
10881
  };
@@ -10918,7 +10917,7 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
10918
10917
  };
10919
10918
  ProfilePicturePickerComponent.prototype._validateFileSize = function (file) {
10920
10919
  if (this.maxFileSize) {
10921
- return file.size > this.maxFileSize;
10920
+ return file.size <= this.maxFileSize;
10922
10921
  }
10923
10922
  return true;
10924
10923
  };
@@ -10980,6 +10979,9 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
10980
10979
  __decorate([
10981
10980
  ViewChild("fileInput", { read: ElementRef })
10982
10981
  ], ProfilePicturePickerComponent.prototype, "fileInput", void 0);
10982
+ __decorate([
10983
+ Output()
10984
+ ], ProfilePicturePickerComponent.prototype, "imageChange", void 0);
10983
10985
  __decorate([
10984
10986
  Output()
10985
10987
  ], ProfilePicturePickerComponent.prototype, "changedImage", void 0);