@seniorsistemas/angular-components 16.3.0 → 16.3.2
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 +46 -12
- 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/dynamic-form/components/lookup/lookup.component.d.ts +1 -0
- 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/dynamic-form/components/lookup/lookup.component.js +12 -2
- 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/dynamic-form/components/lookup/lookup.component.js +12 -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 +43 -8
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +44 -8
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.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';
|
|
@@ -2097,8 +2099,10 @@ var LookupComponent = /** @class */ (function () {
|
|
|
2097
2099
|
this.autocomplete.onOverlayAnimationDone = function (event) { };
|
|
2098
2100
|
};
|
|
2099
2101
|
LookupComponent.prototype.ngOnChanges = function (changes) {
|
|
2100
|
-
if (this.dialogVisible && changes.searchGridData)
|
|
2102
|
+
if (this.dialogVisible && changes.searchGridData) {
|
|
2101
2103
|
this.loading = false;
|
|
2104
|
+
}
|
|
2105
|
+
this._setFocusFilter();
|
|
2102
2106
|
};
|
|
2103
2107
|
LookupComponent.prototype.ngOnDestroy = function () {
|
|
2104
2108
|
this.ngUnsubscribe.next();
|
|
@@ -2274,6 +2278,14 @@ var LookupComponent = /** @class */ (function () {
|
|
|
2274
2278
|
this.selected = [rowData];
|
|
2275
2279
|
this.select();
|
|
2276
2280
|
};
|
|
2281
|
+
LookupComponent.prototype._setFocusFilter = function () {
|
|
2282
|
+
if (this.dialogVisible && !this.collapsed) {
|
|
2283
|
+
var input = document.querySelector("s-dynamic-form input");
|
|
2284
|
+
if (input) {
|
|
2285
|
+
input.focus();
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2277
2289
|
var LookupComponent_1;
|
|
2278
2290
|
LookupComponent.nextId = 0;
|
|
2279
2291
|
LookupComponent.ctorParameters = function () { return [
|
|
@@ -8301,11 +8313,18 @@ var FileValidation;
|
|
|
8301
8313
|
})(FileValidation || (FileValidation = {}));
|
|
8302
8314
|
|
|
8303
8315
|
var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
8304
|
-
function ProfilePicturePickerComponent(imageCropperService) {
|
|
8316
|
+
function ProfilePicturePickerComponent(imageCropperService, confirmationService) {
|
|
8305
8317
|
this.imageCropperService = imageCropperService;
|
|
8318
|
+
this.confirmationService = confirmationService;
|
|
8306
8319
|
this.aspectRatio = 1;
|
|
8307
8320
|
this.removeButtonLabel = "Remover";
|
|
8308
8321
|
this.changeButtonLabel = "Alterar foto";
|
|
8322
|
+
this.confirmationTexts = {
|
|
8323
|
+
removalHeader: "Remover foto de perfil",
|
|
8324
|
+
removalMessage: "Deseja remover sua foto de perfil? Não pode ser revertida.",
|
|
8325
|
+
removalAcceptLabel: "Remover",
|
|
8326
|
+
removalRejectLabel: "Cancelar",
|
|
8327
|
+
};
|
|
8309
8328
|
this.supportedExtensions = [];
|
|
8310
8329
|
this.changedImage = new EventEmitter();
|
|
8311
8330
|
this.invalidFile = new EventEmitter();
|
|
@@ -8351,9 +8370,18 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
|
8351
8370
|
fileInputElement.click();
|
|
8352
8371
|
};
|
|
8353
8372
|
ProfilePicturePickerComponent.prototype.removePhoto = function () {
|
|
8354
|
-
var
|
|
8355
|
-
|
|
8356
|
-
|
|
8373
|
+
var _this = this;
|
|
8374
|
+
this.confirmationService.confirm({
|
|
8375
|
+
message: this.confirmationTexts.removalMessage,
|
|
8376
|
+
acceptLabel: this.confirmationTexts.removalAcceptLabel,
|
|
8377
|
+
rejectLabel: this.confirmationTexts.removalRejectLabel,
|
|
8378
|
+
header: this.confirmationTexts.removalHeader,
|
|
8379
|
+
accept: function () {
|
|
8380
|
+
var fileInputElement = _this.fileInput.nativeElement;
|
|
8381
|
+
fileInputElement.value = "";
|
|
8382
|
+
_this.image = "";
|
|
8383
|
+
},
|
|
8384
|
+
});
|
|
8357
8385
|
};
|
|
8358
8386
|
ProfilePicturePickerComponent.prototype.photoSelected = function (event) {
|
|
8359
8387
|
this._showImageCropper(event.srcElement.files);
|
|
@@ -8419,7 +8447,8 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
|
8419
8447
|
return right - left;
|
|
8420
8448
|
};
|
|
8421
8449
|
ProfilePicturePickerComponent.ctorParameters = function () { return [
|
|
8422
|
-
{ type: ImageCropperService }
|
|
8450
|
+
{ type: ImageCropperService },
|
|
8451
|
+
{ type: ConfirmationService }
|
|
8423
8452
|
]; };
|
|
8424
8453
|
__decorate([
|
|
8425
8454
|
Input()
|
|
@@ -8442,6 +8471,9 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
|
8442
8471
|
__decorate([
|
|
8443
8472
|
Input()
|
|
8444
8473
|
], ProfilePicturePickerComponent.prototype, "changeButtonLabel", void 0);
|
|
8474
|
+
__decorate([
|
|
8475
|
+
Input()
|
|
8476
|
+
], ProfilePicturePickerComponent.prototype, "confirmationTexts", void 0);
|
|
8445
8477
|
__decorate([
|
|
8446
8478
|
Input()
|
|
8447
8479
|
], ProfilePicturePickerComponent.prototype, "maxFileSize", void 0);
|
|
@@ -8484,7 +8516,7 @@ var ProfilePicturePickerComponent = /** @class */ (function () {
|
|
|
8484
8516
|
ProfilePicturePickerComponent = __decorate([
|
|
8485
8517
|
Component({
|
|
8486
8518
|
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>",
|
|
8519
|
+
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
8520
|
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
8521
|
})
|
|
8490
8522
|
], ProfilePicturePickerComponent);
|
|
@@ -8501,10 +8533,14 @@ var ProfilePicturePickerModule = /** @class */ (function () {
|
|
|
8501
8533
|
ButtonModule,
|
|
8502
8534
|
ThumbnailModule,
|
|
8503
8535
|
ImageCropperModule,
|
|
8536
|
+
ConfirmDialogModule,
|
|
8504
8537
|
],
|
|
8505
8538
|
declarations: [ProfilePicturePickerComponent],
|
|
8506
8539
|
exports: [ProfilePicturePickerComponent],
|
|
8507
|
-
providers: [
|
|
8540
|
+
providers: [
|
|
8541
|
+
ImageCropperService,
|
|
8542
|
+
ConfirmationService,
|
|
8543
|
+
],
|
|
8508
8544
|
})
|
|
8509
8545
|
], ProfilePicturePickerModule);
|
|
8510
8546
|
return ProfilePicturePickerModule;
|