@seniorsistemas/angular-components 16.3.0 → 16.3.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.
- package/bundles/seniorsistemas-angular-components.umd.js +35 -11
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/profile-picture-picker/models/confirmation-texts.d.ts +6 -0
- package/components/profile-picture-picker/profile-picture-picker.component.d.ts +5 -1
- package/esm2015/components/profile-picture-picker/models/confirmation-texts.js +1 -0
- package/esm2015/components/profile-picture-picker/profile-picture-picker.component.js +27 -7
- package/esm2015/components/profile-picture-picker/profile-picture-picker.module.js +8 -2
- package/esm5/components/profile-picture-picker/models/confirmation-texts.js +1 -0
- package/esm5/components/profile-picture-picker/profile-picture-picker.component.js +28 -7
- package/esm5/components/profile-picture-picker/profile-picture-picker.module.js +8 -2
- package/fesm2015/seniorsistemas-angular-components.js +32 -7
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +33 -7
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -43,6 +43,8 @@ import * as elementResizeDetectorMaker_ from 'element-resize-detector';
|
|
|
43
43
|
import { FocusTrapFactory, A11yModule } from '@angular/cdk/a11y';
|
|
44
44
|
import { ScrollPanelModule } from 'primeng/scrollpanel';
|
|
45
45
|
import { Sidebar, SidebarModule as SidebarModule$1 } from 'primeng/sidebar';
|
|
46
|
+
import { ConfirmationService } from 'primeng/api';
|
|
47
|
+
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
46
48
|
import { EditorView } from '@codemirror/view';
|
|
47
49
|
import { StateField, StateEffect, EditorState } from '@codemirror/state';
|
|
48
50
|
import { setDiagnostics } from '@codemirror/lint';
|
|
@@ -8301,11 +8303,18 @@ var FileValidation;
|
|
|
8301
8303
|
})(FileValidation || (FileValidation = {}));
|
|
8302
8304
|
|
|
8303
8305
|
var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
8304
|
-
function ProfilePicturePickerComponent(imageCropperService) {
|
|
8306
|
+
function ProfilePicturePickerComponent(imageCropperService, confirmationService) {
|
|
8305
8307
|
this.imageCropperService = imageCropperService;
|
|
8308
|
+
this.confirmationService = confirmationService;
|
|
8306
8309
|
this.aspectRatio = 1;
|
|
8307
8310
|
this.removeButtonLabel = "Remover";
|
|
8308
8311
|
this.changeButtonLabel = "Alterar foto";
|
|
8312
|
+
this.confirmationTexts = {
|
|
8313
|
+
removalHeader: "Remover foto de perfil",
|
|
8314
|
+
removalMessage: "Deseja remover sua foto de perfil? Não pode ser revertida.",
|
|
8315
|
+
removalAcceptLabel: "Remover",
|
|
8316
|
+
removalRejectLabel: "Cancelar",
|
|
8317
|
+
};
|
|
8309
8318
|
this.supportedExtensions = [];
|
|
8310
8319
|
this.changedImage = new EventEmitter();
|
|
8311
8320
|
this.invalidFile = new EventEmitter();
|
|
@@ -8351,9 +8360,18 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
|
8351
8360
|
fileInputElement.click();
|
|
8352
8361
|
};
|
|
8353
8362
|
ProfilePicturePickerComponent.prototype.removePhoto = function () {
|
|
8354
|
-
var
|
|
8355
|
-
|
|
8356
|
-
|
|
8363
|
+
var _this = this;
|
|
8364
|
+
this.confirmationService.confirm({
|
|
8365
|
+
message: this.confirmationTexts.removalMessage,
|
|
8366
|
+
acceptLabel: this.confirmationTexts.removalAcceptLabel,
|
|
8367
|
+
rejectLabel: this.confirmationTexts.removalRejectLabel,
|
|
8368
|
+
header: this.confirmationTexts.removalHeader,
|
|
8369
|
+
accept: function () {
|
|
8370
|
+
var fileInputElement = _this.fileInput.nativeElement;
|
|
8371
|
+
fileInputElement.value = "";
|
|
8372
|
+
_this.image = "";
|
|
8373
|
+
},
|
|
8374
|
+
});
|
|
8357
8375
|
};
|
|
8358
8376
|
ProfilePicturePickerComponent.prototype.photoSelected = function (event) {
|
|
8359
8377
|
this._showImageCropper(event.srcElement.files);
|
|
@@ -8419,7 +8437,8 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
|
8419
8437
|
return right - left;
|
|
8420
8438
|
};
|
|
8421
8439
|
ProfilePicturePickerComponent.ctorParameters = function () { return [
|
|
8422
|
-
{ type: ImageCropperService }
|
|
8440
|
+
{ type: ImageCropperService },
|
|
8441
|
+
{ type: ConfirmationService }
|
|
8423
8442
|
]; };
|
|
8424
8443
|
__decorate([
|
|
8425
8444
|
Input()
|
|
@@ -8442,6 +8461,9 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
|
8442
8461
|
__decorate([
|
|
8443
8462
|
Input()
|
|
8444
8463
|
], ProfilePicturePickerComponent.prototype, "changeButtonLabel", void 0);
|
|
8464
|
+
__decorate([
|
|
8465
|
+
Input()
|
|
8466
|
+
], ProfilePicturePickerComponent.prototype, "confirmationTexts", void 0);
|
|
8445
8467
|
__decorate([
|
|
8446
8468
|
Input()
|
|
8447
8469
|
], ProfilePicturePickerComponent.prototype, "maxFileSize", void 0);
|
|
@@ -8484,7 +8506,7 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
|
8484
8506
|
ProfilePicturePickerComponent = __decorate([
|
|
8485
8507
|
Component({
|
|
8486
8508
|
selector: "s-profile-picture-picker",
|
|
8487
|
-
template: "<input #fileInput [accept]=\"accept\" class=\"file-input\" type=\"file\" (change)=\"photoSelected($event)\">\n<div #uploadPicture class=\"upload-picture\">\n <s-thumbnail\n #thumbnail\n iconClass=\"far fa-user\"\n [imageSource]=\"image\"\n [hasAction]=\"!image\"\n (click)=\"selectPhoto()\">\n </s-thumbnail>\n <div #info class=\"info\">\n <ng-container *ngIf=\"image; then withImage; else noImage\"></ng-container>\n <p class=\"subtitle\">{{ subtitle }}</p>\n </div>\n</div>\n\n<ng-template #withImage>\n <div class=\"buttons\">\n <s-button\n [label]=\"changeButtonLabel\"\n priority=\"primary\"\n (onClick)=\"selectPhoto()\">\n </s-button>\n <s-button\n [label]=\"removeButtonLabel\"\n priority=\"secondary\"\n (onClick)=\"removePhoto()\">\n </s-button>\n </div>\n</ng-template>\n\n<ng-template #noImage>\n <p class=\"title\">\n {{ simpleTitle }}\n <span\n class=\"action-title\"\n (click)=\"selectPhoto()\">\n {{ actionTitle }}\n </span>\n </p>\n</ng-template>",
|
|
8509
|
+
template: "<p-confirmDialog></p-confirmDialog>\n\n<input #fileInput [accept]=\"accept\" class=\"file-input\" type=\"file\" (change)=\"photoSelected($event)\">\n<div #uploadPicture class=\"upload-picture\">\n <s-thumbnail\n #thumbnail\n iconClass=\"far fa-user\"\n [imageSource]=\"image\"\n [hasAction]=\"!image\"\n (click)=\"selectPhoto()\">\n </s-thumbnail>\n <div #info class=\"info\">\n <ng-container *ngIf=\"image; then withImage; else noImage\"></ng-container>\n <p class=\"subtitle\">{{ subtitle }}</p>\n </div>\n</div>\n\n<ng-template #withImage>\n <div class=\"buttons\">\n <s-button\n [label]=\"changeButtonLabel\"\n priority=\"primary\"\n (onClick)=\"selectPhoto()\">\n </s-button>\n <s-button\n [label]=\"removeButtonLabel\"\n priority=\"secondary\"\n (onClick)=\"removePhoto()\">\n </s-button>\n </div>\n</ng-template>\n\n<ng-template #noImage>\n <p class=\"title\">\n {{ simpleTitle }}\n <span\n class=\"action-title\"\n (click)=\"selectPhoto()\">\n {{ actionTitle }}\n </span>\n </p>\n</ng-template>",
|
|
8488
8510
|
styles: [".file-input{display:none}.upload-picture{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.upload-picture .info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:12px 20px;-ms-flex-align:start;align-items:flex-start}.upload-picture .info .title{font-family:\"Open Sans\",sans-serif;font-weight:700;font-size:.875rem;line-height:150%;color:#333}.upload-picture .info .title .action-title{cursor:pointer;color:#428bca}.upload-picture .info .buttons{display:-ms-flexbox;display:flex;gap:8px}.upload-picture .info .buttons s-button{margin:0}.upload-picture .info .subtitle{padding:6px 0;font-family:\"Open Sans\",sans-serif;font-weight:400;font-size:.75rem;line-height:150%;color:#697882;text-align:center}.upload-picture--small .info{-ms-flex-align:center;align-items:center}.upload-picture--small .info .subtitle,.upload-picture--small .info .title{text-align:center}.upload-picture--small .info .buttons{-ms-flex-pack:center;justify-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap}"]
|
|
8489
8511
|
})
|
|
8490
8512
|
], ProfilePicturePickerComponent);
|
|
@@ -8501,10 +8523,14 @@ var ProfilePicturePickerModule = /** @class */ (function () {
|
|
|
8501
8523
|
ButtonModule,
|
|
8502
8524
|
ThumbnailModule,
|
|
8503
8525
|
ImageCropperModule,
|
|
8526
|
+
ConfirmDialogModule,
|
|
8504
8527
|
],
|
|
8505
8528
|
declarations: [ProfilePicturePickerComponent],
|
|
8506
8529
|
exports: [ProfilePicturePickerComponent],
|
|
8507
|
-
providers: [
|
|
8530
|
+
providers: [
|
|
8531
|
+
ImageCropperService,
|
|
8532
|
+
ConfirmationService,
|
|
8533
|
+
],
|
|
8508
8534
|
})
|
|
8509
8535
|
], ProfilePicturePickerModule);
|
|
8510
8536
|
return ProfilePicturePickerModule;
|