onshore-forms 0.0.26 → 0.0.28
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/esm2020/lib/components/form-image-item/form-image-item.component.mjs +8 -49
- package/esm2020/lib/components/image-chooser/image-chooser.component.mjs +3 -3
- package/esm2020/lib/components/image-placeholder/image-placeholder.component.mjs +3 -3
- package/esm2020/lib/components/webcam/webcam.component.mjs +3 -3
- package/fesm2015/onshore-forms.mjs +13 -54
- package/fesm2015/onshore-forms.mjs.map +1 -1
- package/fesm2020/onshore-forms.mjs +13 -54
- package/fesm2020/onshore-forms.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -534,10 +534,10 @@ class OnshoreImagePlaceholderComponent {
|
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
OnshoreImagePlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreImagePlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
537
|
-
OnshoreImagePlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreImagePlaceholderComponent, selector: "onshore-image-placeholder", inputs: { placeholderIcon: "placeholderIcon", placeholderImage: "placeholderImage", image: "image", imageStyle: "imageStyle", placeholderStyle: "placeholderStyle", showLoader: "showLoader" }, ngImport: i0, template: "<div
|
|
537
|
+
OnshoreImagePlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreImagePlaceholderComponent, selector: "onshore-image-placeholder", inputs: { placeholderIcon: "placeholderIcon", placeholderImage: "placeholderImage", image: "image", imageStyle: "imageStyle", placeholderStyle: "placeholderStyle", showLoader: "showLoader" }, ngImport: i0, template: "<div [hidden]=\"!imageLoaded || !image\">\n <img [style]=\"imageStyle\" [src]=\"image\" (load)=\"loadReady()\" (abort)=\"abort()\" />\n</div>\n\n<div *ngIf=\"!imageLoaded || !image\" class=\"flex justify-content-center align-items-center\" [style]=\"placeholderStyle\" [class.bg-gray-200]=\"placeholderIcon\" [class.p-2]=\"placeholderIcon\">\n <i *ngIf=\"placeholderIcon\" [class]=\"'text-muted fa ' + placeholderIcon\" [class.opacity-20]=\"showLoader && image\"></i>\n <img *ngIf=\"placeholderImage\" [src]=\"placeholderImage\" [class.opacity-20]=\"showLoader && image\" class=\"h-full\" />\n <i *ngIf=\"showLoader && image\" class=\"fas fa-circle-notch fa-spin fa-2x absolute\"></i>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
538
538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreImagePlaceholderComponent, decorators: [{
|
|
539
539
|
type: Component,
|
|
540
|
-
args: [{ selector: 'onshore-image-placeholder', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div
|
|
540
|
+
args: [{ selector: 'onshore-image-placeholder', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [hidden]=\"!imageLoaded || !image\">\n <img [style]=\"imageStyle\" [src]=\"image\" (load)=\"loadReady()\" (abort)=\"abort()\" />\n</div>\n\n<div *ngIf=\"!imageLoaded || !image\" class=\"flex justify-content-center align-items-center\" [style]=\"placeholderStyle\" [class.bg-gray-200]=\"placeholderIcon\" [class.p-2]=\"placeholderIcon\">\n <i *ngIf=\"placeholderIcon\" [class]=\"'text-muted fa ' + placeholderIcon\" [class.opacity-20]=\"showLoader && image\"></i>\n <img *ngIf=\"placeholderImage\" [src]=\"placeholderImage\" [class.opacity-20]=\"showLoader && image\" class=\"h-full\" />\n <i *ngIf=\"showLoader && image\" class=\"fas fa-circle-notch fa-spin fa-2x absolute\"></i>\n</div>\n" }]
|
|
541
541
|
}], ctorParameters: function () { return []; }, propDecorators: { placeholderIcon: [{
|
|
542
542
|
type: Input
|
|
543
543
|
}], placeholderImage: [{
|
|
@@ -611,10 +611,10 @@ class OnshoreImageChooserComponent {
|
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
OnshoreImageChooserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreImageChooserComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
614
|
-
OnshoreImageChooserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreImageChooserComponent, selector: "onshore-image-chooser", inputs: { imageSettings: "imageSettings" }, outputs: { choosen: "choosen", canceled: "canceled" }, ngImport: i0, template: "<div class=\"flex flex-column justify-content-center align-items-center w-full\">\n\n <div *ngIf=\"!image\" class=\"flex justify-content-center flex-column align-items-center w-full\">\n
|
|
614
|
+
OnshoreImageChooserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreImageChooserComponent, selector: "onshore-image-chooser", inputs: { imageSettings: "imageSettings" }, outputs: { choosen: "choosen", canceled: "canceled" }, ngImport: i0, template: "<div class=\"flex flex-column justify-content-center align-items-center w-full\">\n\n <div *ngIf=\"!image\" class=\"flex justify-content-center flex-column align-items-center w-full\">\n <div\n class=\"onshore-image-upload flex flex-column justify-content-between align-items-center rounded-lg p-4 relative m-3\"\n [class.onshore-border-gray-3]=\"drag\"\n [class.onshore-border-danger]=\"imageError != imageErrorType.none\">\n <i class=\"fa fa-image fa-5x onshore-color-gray-4\"></i>\n <small class=\"onshore-color-gray-4 mb-2\">{{'form.imageControl.dropImageLabel' | translate}}</small>\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-file\"\n [label]=\"'form.imageControl.imageChooserFileButton' | translate\"\n class=\"onshore-button-primary mr-2\">\n </button>\n\n <input\n (change)=\"fileChange($event)\"\n *ngIf=\"!image\"\n accept=\"image/png, image/jpeg, image/webp\"\n class=\"onshore-image-input absolute w-full h-full\"\n type=\"file\"\n (dragenter)=\"drag = true\"\n (dragleave)=\"drag = false\"\n (dragend)=\"drag = false\"\n />\n </div>\n </div>\n\n <div class=\"flex flex-column relative align-items-center w-full\" *ngIf=\"image\">\n <image-cropper\n class=\"m-3\"\n [style]=\"'align-items: center; height: ' + (imageSettings.cropperPreviewHeight * this.imageSettings.aspectRatio) + 'px; width: ' + (imageSettings.cropperPreviewWidth * this.imageSettings.aspectRatio) + 'px'\"\n [class.onshore-cropper-circle]=\"this.imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"this.imageSettings.imageQuality\"\n [alignImage]=\"this.imageSettings.alignImage\"\n [backgroundColor]=\"this.imageSettings.backgroundColor\"\n [containWithinAspectRatio]=\"this.imageSettings.containWithinAspectRatio\"\n [format]=\"this.imageSettings.format\"\n [aspectRatio]=\"this.imageSettings.aspectRatio\"\n [resizeToHeight]=\"this.imageSettings.imageWidth * this.imageSettings.aspectRatio\"\n [resizeToWidth]=\"this.imageSettings.imageHeight * this.imageSettings.aspectRatio\">\n </image-cropper>\n </div>\n\n <div *ngIf=\"imageError\"class=\"pb-2 text-wrap text-center onshore-color-danger\">\n <small *ngIf=\"imageError == imageErrorType.ratio\">{{'form.imageControl.imageErrorRatio' | translate: {resizeToWidth: this.imageSettings.imageWidth, resizeToHeight: this.imageSettings.imageHeight} }}</small>\n <small *ngIf=\"imageError == imageErrorType.fileType\">{{'form.imageControl.imageErrorFileType' | translate}}</small>\n <small *ngIf=\"imageError == imageErrorType.size\">{{'form.imageControl.imageErrorSize' | translate}}</small>\n </div>\n</div>\n\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'form.imageControl.imageChooserCancelButton' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"clear(); canceled.emit(true)\">\n </button>\n\n <button pButton\n type=\"button\"\n [label]=\"'form.imageControl.imageChooserSelectButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n [disabled]=\"!image\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i3$2.Footer, selector: "p-footer" }, { kind: "component", type: i4$1.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "format", "transform", "maintainAspectRatio", "aspectRatio", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
615
615
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreImageChooserComponent, decorators: [{
|
|
616
616
|
type: Component,
|
|
617
|
-
args: [{ selector: 'onshore-image-chooser', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column justify-content-center align-items-center w-full\">\n\n <div *ngIf=\"!image\" class=\"flex justify-content-center flex-column align-items-center w-full\">\n
|
|
617
|
+
args: [{ selector: 'onshore-image-chooser', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-column justify-content-center align-items-center w-full\">\n\n <div *ngIf=\"!image\" class=\"flex justify-content-center flex-column align-items-center w-full\">\n <div\n class=\"onshore-image-upload flex flex-column justify-content-between align-items-center rounded-lg p-4 relative m-3\"\n [class.onshore-border-gray-3]=\"drag\"\n [class.onshore-border-danger]=\"imageError != imageErrorType.none\">\n <i class=\"fa fa-image fa-5x onshore-color-gray-4\"></i>\n <small class=\"onshore-color-gray-4 mb-2\">{{'form.imageControl.dropImageLabel' | translate}}</small>\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-file\"\n [label]=\"'form.imageControl.imageChooserFileButton' | translate\"\n class=\"onshore-button-primary mr-2\">\n </button>\n\n <input\n (change)=\"fileChange($event)\"\n *ngIf=\"!image\"\n accept=\"image/png, image/jpeg, image/webp\"\n class=\"onshore-image-input absolute w-full h-full\"\n type=\"file\"\n (dragenter)=\"drag = true\"\n (dragleave)=\"drag = false\"\n (dragend)=\"drag = false\"\n />\n </div>\n </div>\n\n <div class=\"flex flex-column relative align-items-center w-full\" *ngIf=\"image\">\n <image-cropper\n class=\"m-3\"\n [style]=\"'align-items: center; height: ' + (imageSettings.cropperPreviewHeight * this.imageSettings.aspectRatio) + 'px; width: ' + (imageSettings.cropperPreviewWidth * this.imageSettings.aspectRatio) + 'px'\"\n [class.onshore-cropper-circle]=\"this.imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"this.imageSettings.imageQuality\"\n [alignImage]=\"this.imageSettings.alignImage\"\n [backgroundColor]=\"this.imageSettings.backgroundColor\"\n [containWithinAspectRatio]=\"this.imageSettings.containWithinAspectRatio\"\n [format]=\"this.imageSettings.format\"\n [aspectRatio]=\"this.imageSettings.aspectRatio\"\n [resizeToHeight]=\"this.imageSettings.imageWidth * this.imageSettings.aspectRatio\"\n [resizeToWidth]=\"this.imageSettings.imageHeight * this.imageSettings.aspectRatio\">\n </image-cropper>\n </div>\n\n <div *ngIf=\"imageError\"class=\"pb-2 text-wrap text-center onshore-color-danger\">\n <small *ngIf=\"imageError == imageErrorType.ratio\">{{'form.imageControl.imageErrorRatio' | translate: {resizeToWidth: this.imageSettings.imageWidth, resizeToHeight: this.imageSettings.imageHeight} }}</small>\n <small *ngIf=\"imageError == imageErrorType.fileType\">{{'form.imageControl.imageErrorFileType' | translate}}</small>\n <small *ngIf=\"imageError == imageErrorType.size\">{{'form.imageControl.imageErrorSize' | translate}}</small>\n </div>\n</div>\n\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'form.imageControl.imageChooserCancelButton' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"clear(); canceled.emit(true)\">\n </button>\n\n <button pButton\n type=\"button\"\n [label]=\"'form.imageControl.imageChooserSelectButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n [disabled]=\"!image\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n" }]
|
|
618
618
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { imageSettings: [{
|
|
619
619
|
type: Input
|
|
620
620
|
}], choosen: [{
|
|
@@ -651,10 +651,10 @@ class WebcamComponent {
|
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
WebcamComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: WebcamComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
654
|
-
WebcamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: WebcamComponent, selector: "onshore-webcam", inputs: { imageSettings: "imageSettings" }, outputs: { shot: "shot", canceled: "canceled" }, ngImport: i0, template: "<div class=\"flex w-full justify-content-center align-items-center overflow-hidden p-2\">\n <webcam *ngIf=\"!image || image == ''\"\n [mirrorImage]=\"'never'\"\n [height]=\"imageSettings.webcamWidth\"\n [width]=\"imageSettings.webcamHeight\"\n [allowCameraSwitch]=\"true\"\n [trigger]=\"triggerObservable\"\n [imageQuality]=\"imageSettings.imageQuality / 100\"\n (imageCapture)=\"camImageShot($event)\">\n </webcam>\n\n <image-cropper *ngIf=\"image && image != ''\"\n class=\"m-3\" [style]=\"'height: ' + imageSettings.cropperPreviewWidth + 'px; width: ' + imageSettings.cropperPreviewHeight + 'px'\"\n [class.onshore-cropper-circle]=\"imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"imageSettings.imageQuality\"\n [alignImage]=\"imageSettings.alignImage\"\n [backgroundColor]=\"imageSettings.backgroundColor\"\n [containWithinAspectRatio]=\"imageSettings.containWithinAspectRatio\"\n [format]=\"imageSettings.format\"\n [aspectRatio]=\"imageSettings.aspectRatio\"\n [resizeToHeight]=\"imageSettings.imageHeight\"\n [resizeToWidth]=\"imageSettings.imageWidth\">\n </image-cropper>\n</div>\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'global.cancel' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"canceled.emit(true)\">\n </button>\n\n <button *ngIf=\"!image || image == ''\"\n pButton\n type=\"button\"\n [label]=\"'form.imageControl.webcamSmileButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-laugh-wink\"\n (click)=\"triggerSnapshot()\">\n </button>\n\n <button *ngIf=\"image && image != ''\"\n pButton\n type=\"button\"\n [label]=\"'global.use' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i3$2.Footer, selector: "p-footer" }, { kind: "component", type: i4$1.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "format", "transform", "maintainAspectRatio", "aspectRatio", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "component", type: i5$1.WebcamComponent, selector: "webcam", inputs: ["width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
654
|
+
WebcamComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: WebcamComponent, selector: "onshore-webcam", inputs: { imageSettings: "imageSettings" }, outputs: { shot: "shot", canceled: "canceled" }, ngImport: i0, template: "<div class=\"flex w-full justify-content-center align-items-center overflow-hidden p-2\">\n <webcam *ngIf=\"!image || image == ''\"\n [mirrorImage]=\"'never'\"\n [height]=\"imageSettings.webcamWidth * this.imageSettings.aspectRatio\"\n [width]=\"imageSettings.webcamHeight * this.imageSettings.aspectRatio\"\n [allowCameraSwitch]=\"true\"\n [trigger]=\"triggerObservable\"\n [imageQuality]=\"imageSettings.imageQuality / 100\"\n (imageCapture)=\"camImageShot($event)\">\n </webcam>\n\n <image-cropper *ngIf=\"image && image != ''\"\n class=\"m-3\" [style]=\"'height: ' + (imageSettings.cropperPreviewWidth * this.imageSettings.aspectRatio) + 'px; width: ' + (imageSettings.cropperPreviewHeight * this.imageSettings.aspectRatio) + 'px'\"\n [class.onshore-cropper-circle]=\"imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"imageSettings.imageQuality\"\n [alignImage]=\"imageSettings.alignImage\"\n [backgroundColor]=\"imageSettings.backgroundColor\"\n [containWithinAspectRatio]=\"imageSettings.containWithinAspectRatio\"\n [format]=\"imageSettings.format\"\n [aspectRatio]=\"imageSettings.aspectRatio\"\n [resizeToHeight]=\"imageSettings.imageHeight * this.imageSettings.aspectRatio\"\n [resizeToWidth]=\"this.imageSettings.imageWidth * this.imageSettings.aspectRatio\">\n </image-cropper>\n</div>\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'global.cancel' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"canceled.emit(true)\">\n </button>\n\n <button *ngIf=\"!image || image == ''\"\n pButton\n type=\"button\"\n [label]=\"'form.imageControl.webcamSmileButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-laugh-wink\"\n (click)=\"triggerSnapshot()\">\n </button>\n\n <button *ngIf=\"image && image != ''\"\n pButton\n type=\"button\"\n [label]=\"'global.use' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i3$2.Footer, selector: "p-footer" }, { kind: "component", type: i4$1.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "format", "transform", "maintainAspectRatio", "aspectRatio", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "component", type: i5$1.WebcamComponent, selector: "webcam", inputs: ["width", "height", "videoOptions", "allowCameraSwitch", "mirrorImage", "captureImageData", "imageType", "imageQuality", "trigger", "switchCamera"], outputs: ["imageCapture", "initError", "imageClick", "cameraSwitched"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
655
655
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: WebcamComponent, decorators: [{
|
|
656
656
|
type: Component,
|
|
657
|
-
args: [{ selector: 'onshore-webcam', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex w-full justify-content-center align-items-center overflow-hidden p-2\">\n <webcam *ngIf=\"!image || image == ''\"\n [mirrorImage]=\"'never'\"\n [height]=\"imageSettings.webcamWidth\"\n [width]=\"imageSettings.webcamHeight\"\n [allowCameraSwitch]=\"true\"\n [trigger]=\"triggerObservable\"\n [imageQuality]=\"imageSettings.imageQuality / 100\"\n (imageCapture)=\"camImageShot($event)\">\n </webcam>\n\n <image-cropper *ngIf=\"image && image != ''\"\n class=\"m-3\" [style]=\"'height: ' + imageSettings.cropperPreviewWidth + 'px; width: ' + imageSettings.cropperPreviewHeight + 'px'\"\n [class.onshore-cropper-circle]=\"imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"imageSettings.imageQuality\"\n [alignImage]=\"imageSettings.alignImage\"\n [backgroundColor]=\"imageSettings.backgroundColor\"\n [containWithinAspectRatio]=\"imageSettings.containWithinAspectRatio\"\n [format]=\"imageSettings.format\"\n [aspectRatio]=\"imageSettings.aspectRatio\"\n [resizeToHeight]=\"imageSettings.imageHeight\"\n [resizeToWidth]=\"imageSettings.imageWidth\">\n </image-cropper>\n</div>\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'global.cancel' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"canceled.emit(true)\">\n </button>\n\n <button *ngIf=\"!image || image == ''\"\n pButton\n type=\"button\"\n [label]=\"'form.imageControl.webcamSmileButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-laugh-wink\"\n (click)=\"triggerSnapshot()\">\n </button>\n\n <button *ngIf=\"image && image != ''\"\n pButton\n type=\"button\"\n [label]=\"'global.use' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n\n" }]
|
|
657
|
+
args: [{ selector: 'onshore-webcam', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex w-full justify-content-center align-items-center overflow-hidden p-2\">\n <webcam *ngIf=\"!image || image == ''\"\n [mirrorImage]=\"'never'\"\n [height]=\"imageSettings.webcamWidth * this.imageSettings.aspectRatio\"\n [width]=\"imageSettings.webcamHeight * this.imageSettings.aspectRatio\"\n [allowCameraSwitch]=\"true\"\n [trigger]=\"triggerObservable\"\n [imageQuality]=\"imageSettings.imageQuality / 100\"\n (imageCapture)=\"camImageShot($event)\">\n </webcam>\n\n <image-cropper *ngIf=\"image && image != ''\"\n class=\"m-3\" [style]=\"'height: ' + (imageSettings.cropperPreviewWidth * this.imageSettings.aspectRatio) + 'px; width: ' + (imageSettings.cropperPreviewHeight * this.imageSettings.aspectRatio) + 'px'\"\n [class.onshore-cropper-circle]=\"imageSettings.circleCropper\"\n (imageCropped)=\"imageCropped($event)\"\n [imageBase64]=\"image\"\n [imageQuality]=\"imageSettings.imageQuality\"\n [alignImage]=\"imageSettings.alignImage\"\n [backgroundColor]=\"imageSettings.backgroundColor\"\n [containWithinAspectRatio]=\"imageSettings.containWithinAspectRatio\"\n [format]=\"imageSettings.format\"\n [aspectRatio]=\"imageSettings.aspectRatio\"\n [resizeToHeight]=\"imageSettings.imageHeight * this.imageSettings.aspectRatio\"\n [resizeToWidth]=\"this.imageSettings.imageWidth * this.imageSettings.aspectRatio\">\n </image-cropper>\n</div>\n\n<p-footer>\n <div class=\"flex justify-content-end align-items-center mt-2\">\n\n <button pButton\n type=\"button\"\n icon=\"fa fa-times\"\n [label]=\"'global.cancel' | translate\"\n class=\"onshore-button-light mr-2\"\n (click)=\"canceled.emit(true)\">\n </button>\n\n <button *ngIf=\"!image || image == ''\"\n pButton\n type=\"button\"\n [label]=\"'form.imageControl.webcamSmileButton' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-laugh-wink\"\n (click)=\"triggerSnapshot()\">\n </button>\n\n <button *ngIf=\"image && image != ''\"\n pButton\n type=\"button\"\n [label]=\"'global.use' | translate\"\n class=\"onshore-button-primary\"\n icon=\"fa fa-check\"\n (click)=\"imageCroppedReady()\">\n </button>\n </div>\n</p-footer>\n\n\n" }]
|
|
658
658
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { imageSettings: [{
|
|
659
659
|
type: Input
|
|
660
660
|
}], shot: [{
|
|
@@ -710,10 +710,10 @@ class OnshoreFormImageItemComponent {
|
|
|
710
710
|
if (image) {
|
|
711
711
|
this.image = image;
|
|
712
712
|
setTimeout(() => {
|
|
713
|
-
this.cdr.markForCheck();
|
|
714
713
|
this.ngControl?.control?.setValue(this.image);
|
|
715
714
|
this.ngControl?.control?.markAsDirty();
|
|
716
715
|
this.imageReady.emit(this.image);
|
|
716
|
+
this.cdr.markForCheck();
|
|
717
717
|
}, 500);
|
|
718
718
|
}
|
|
719
719
|
}
|
|
@@ -722,10 +722,10 @@ class OnshoreFormImageItemComponent {
|
|
|
722
722
|
if (image) {
|
|
723
723
|
this.image = image;
|
|
724
724
|
setTimeout(() => {
|
|
725
|
-
this.cdr.markForCheck();
|
|
726
725
|
this.ngControl?.control?.setValue(this.image);
|
|
727
726
|
this.ngControl?.control?.markAsDirty();
|
|
728
727
|
this.imageReady.emit(this.image);
|
|
728
|
+
this.cdr.markForCheck();
|
|
729
729
|
}, 500);
|
|
730
730
|
}
|
|
731
731
|
}
|
|
@@ -738,6 +738,7 @@ class OnshoreFormImageItemComponent {
|
|
|
738
738
|
}
|
|
739
739
|
this.ngControl?.control?.setValue(null);
|
|
740
740
|
this.image = '';
|
|
741
|
+
this.cdr.markForCheck();
|
|
741
742
|
}
|
|
742
743
|
writeValue(obj) {
|
|
743
744
|
if (obj && !obj.includes('base64')) {
|
|
@@ -775,59 +776,17 @@ class OnshoreFormImageItemComponent {
|
|
|
775
776
|
}
|
|
776
777
|
ngOnChanges(changes) {
|
|
777
778
|
const imageSettings = changes['imageSettings']?.currentValue;
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
this.imageSettings.imageWidth = this.defaultImageSettings.imageWidth;
|
|
781
|
-
this.imageSettings.imageHeight = this.defaultImageSettings.imageHeight;
|
|
782
|
-
}
|
|
783
|
-
if (!imageSettings.placeholderIcon && !imageSettings.placeholderImage)
|
|
784
|
-
this.imageSettings.placeholderIcon = this.defaultImageSettings.placeholderIcon;
|
|
785
|
-
if (!imageSettings.aspectRatio)
|
|
786
|
-
this.imageSettings.aspectRatio = this.defaultImageSettings.aspectRatio;
|
|
787
|
-
if (!imageSettings.containWithinAspectRatio)
|
|
788
|
-
this.imageSettings.containWithinAspectRatio = this.defaultImageSettings.containWithinAspectRatio;
|
|
789
|
-
if (imageSettings.imageSelectionEnabled == null)
|
|
790
|
-
this.imageSettings.imageSelectionEnabled = this.defaultImageSettings.imageSelectionEnabled;
|
|
791
|
-
if (imageSettings.mediaSelectionEnabled == null)
|
|
792
|
-
this.imageSettings.mediaSelectionEnabled = this.defaultImageSettings.mediaSelectionEnabled;
|
|
793
|
-
if (imageSettings.webcamSelectionEnabled == null)
|
|
794
|
-
this.imageSettings.webcamSelectionEnabled = this.defaultImageSettings.webcamSelectionEnabled;
|
|
795
|
-
if (imageSettings.deleteEnabled == null)
|
|
796
|
-
this.imageSettings.deleteEnabled = this.defaultImageSettings.deleteEnabled;
|
|
797
|
-
if (imageSettings.containerWidth == null)
|
|
798
|
-
this.imageSettings.containerWidth = this.defaultImageSettings.containerWidth;
|
|
799
|
-
if (imageSettings.containerHeight == null)
|
|
800
|
-
this.imageSettings.containerHeight = this.defaultImageSettings.containerHeight;
|
|
801
|
-
if (imageSettings.imageQuality == null)
|
|
802
|
-
this.imageSettings.imageQuality = this.defaultImageSettings.imageQuality;
|
|
803
|
-
if (imageSettings.format == null)
|
|
804
|
-
this.imageSettings.format = this.defaultImageSettings.format;
|
|
805
|
-
if (imageSettings.alignImage == null)
|
|
806
|
-
this.imageSettings.alignImage = this.defaultImageSettings.alignImage;
|
|
807
|
-
if (imageSettings.cropperPreviewWidth == null)
|
|
808
|
-
this.imageSettings.cropperPreviewWidth = this.defaultImageSettings.cropperPreviewWidth;
|
|
809
|
-
if (imageSettings.cropperPreviewHeight == null)
|
|
810
|
-
this.imageSettings.cropperPreviewHeight = this.defaultImageSettings.cropperPreviewHeight;
|
|
811
|
-
if (imageSettings.circleCropper == null)
|
|
812
|
-
this.imageSettings.circleCropper = this.defaultImageSettings.circleCropper;
|
|
813
|
-
if (imageSettings.maxFileSize == null)
|
|
814
|
-
this.imageSettings.maxFileSize = this.defaultImageSettings.maxFileSize;
|
|
815
|
-
if (imageSettings.backgroundColor == null)
|
|
816
|
-
this.imageSettings.backgroundColor = this.defaultImageSettings.backgroundColor;
|
|
817
|
-
if (imageSettings.webcamWidth == null)
|
|
818
|
-
this.imageSettings.webcamWidth = this.defaultImageSettings.webcamWidth;
|
|
819
|
-
if (imageSettings.webcamHeight == null)
|
|
820
|
-
this.imageSettings.webcamHeight = this.defaultImageSettings.webcamHeight;
|
|
821
|
-
}
|
|
779
|
+
this.imageSettings = { ...this.defaultImageSettings, ...imageSettings };
|
|
780
|
+
console.log("imageSettings", changes['imageSettings'], this.imageSettings);
|
|
822
781
|
this.removeImage();
|
|
823
782
|
this.cdr.markForCheck();
|
|
824
783
|
}
|
|
825
784
|
}
|
|
826
785
|
OnshoreFormImageItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormImageItemComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.NgControl, optional: true, self: true }, { token: i2$4.DialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
827
|
-
OnshoreFormImageItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormImageItemComponent, selector: "onshore-form-image-item", inputs: { formTemplate: "formTemplate", imageSettings: "imageSettings" }, outputs: { imageDeleted: "imageDeleted", imageCleared: "imageCleared", imageReady: "imageReady", selectFromMedia: "selectFromMedia", isLoading: "isLoading" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <div class=\"w-full flex align-items-center
|
|
786
|
+
OnshoreFormImageItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: OnshoreFormImageItemComponent, selector: "onshore-form-image-item", inputs: { formTemplate: "formTemplate", imageSettings: "imageSettings" }, outputs: { imageDeleted: "imageDeleted", imageCleared: "imageCleared", imageReady: "imageReady", selectFromMedia: "selectFromMedia", isLoading: "isLoading" }, usesOnChanges: true, ngImport: i0, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <div class=\"w-full flex align-items-center\" [class.flex-column]=\"formTemplate.layout === OnshoreFormTemplateLayout.vertical\">\n\n <div class=\"onshore-border-gray-4 border-solid border-1 overflow-hidden\"\n [style]=\"'background-color: white; width: ' + imageSettings.containerWidth + 'px; height: ' + imageSettings.containerHeight + 'px'\">\n <onshore-image-placeholder\n class=\"w-full\"\n [image]=\"image\"\n [imageStyle]=\"'width: 100%; height: 100%'\"\n [placeholderIcon]=\"imageSettings.placeholderIcon\"\n [placeholderImage]=\"imageSettings.placeholderImage\"\n [placeholderStyle]=\"'width: 100%; height: 100%'\">\n </onshore-image-placeholder>\n </div>\n\n <div class=\"flex flex-column m-4\">\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.imageSelectionEnabled\"\n icon=\"fa fa-image\"\n [label]=\"'form.imageControl.uploadImageButton' | translate\"\n class=\"onshore-button-primary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true; cdr.detectChanges()\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.webcamSelectionEnabled\"\n icon=\"fa fa-camera\"\n [label]=\"'form.imageControl.webcamImageButton' | translate\"\n class=\"onshore-button-light mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.mediaSelectionEnabled\"\n icon=\"fa fa-photo-video\"\n [label]=\"'form.imageControl.mediaImageButton' | translate\"\n class=\"onshore-button-light mb-2\"\n [disabled]=\"disabled\"\n (click)=\"selectFromMedia.emit()\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.deleteEnabled\"\n icon=\"fa fa-eraser\"\n [label]=\"'form.imageControl.removeImageButton' | translate\"\n class=\"onshore-button-light\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\">\n </button>\n\n </div>\n\n </div>\n</onshore-form-item-container>\n\n<p-dialog [header]=\"'form.imageControl.uploadImageTitle' | translate\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-image-chooser\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [imageSettings]=\"imageSettings\">\n </onshore-image-chooser>\n</p-dialog>\n\n<p-dialog [header]=\"'form.imageControl.webacmImageTitle' | translate\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-webcam\n *ngIf=\"webcamDialogVisible\"\n (shot)=\"getWebcamImage($event)\"\n (canceled)=\"webcamDialogVisible = false\"\n [imageSettings]=\"imageSettings\"></onshore-webcam>\n</p-dialog>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i5$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: OnshoreImagePlaceholderComponent, selector: "onshore-image-placeholder", inputs: ["placeholderIcon", "placeholderImage", "image", "imageStyle", "placeholderStyle", "showLoader"] }, { kind: "component", type: OnshoreFormItemContainer, selector: "onshore-form-item-container", inputs: ["formTemplate", "ngControl"] }, { kind: "component", type: OnshoreImageChooserComponent, selector: "onshore-image-chooser", inputs: ["imageSettings"], outputs: ["choosen", "canceled"] }, { kind: "component", type: WebcamComponent, selector: "onshore-webcam", inputs: ["imageSettings"], outputs: ["shot", "canceled"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
828
787
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: OnshoreFormImageItemComponent, decorators: [{
|
|
829
788
|
type: Component,
|
|
830
|
-
args: [{ selector: 'onshore-form-image-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <div class=\"w-full flex align-items-center
|
|
789
|
+
args: [{ selector: 'onshore-form-image-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<onshore-form-item-container [formTemplate]=\"formTemplate\" [ngControl]=\"ngControl\">\n <div class=\"w-full flex align-items-center\" [class.flex-column]=\"formTemplate.layout === OnshoreFormTemplateLayout.vertical\">\n\n <div class=\"onshore-border-gray-4 border-solid border-1 overflow-hidden\"\n [style]=\"'background-color: white; width: ' + imageSettings.containerWidth + 'px; height: ' + imageSettings.containerHeight + 'px'\">\n <onshore-image-placeholder\n class=\"w-full\"\n [image]=\"image\"\n [imageStyle]=\"'width: 100%; height: 100%'\"\n [placeholderIcon]=\"imageSettings.placeholderIcon\"\n [placeholderImage]=\"imageSettings.placeholderImage\"\n [placeholderStyle]=\"'width: 100%; height: 100%'\">\n </onshore-image-placeholder>\n </div>\n\n <div class=\"flex flex-column m-4\">\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.imageSelectionEnabled\"\n icon=\"fa fa-image\"\n [label]=\"'form.imageControl.uploadImageButton' | translate\"\n class=\"onshore-button-primary mb-2\"\n [disabled]=\"disabled\"\n (click)=\"imageChooserDialogVisible = true; cdr.detectChanges()\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.webcamSelectionEnabled\"\n icon=\"fa fa-camera\"\n [label]=\"'form.imageControl.webcamImageButton' | translate\"\n class=\"onshore-button-light mb-2\"\n [disabled]=\"disabled\"\n (click)=\"webcamDialogVisible = true\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.mediaSelectionEnabled\"\n icon=\"fa fa-photo-video\"\n [label]=\"'form.imageControl.mediaImageButton' | translate\"\n class=\"onshore-button-light mb-2\"\n [disabled]=\"disabled\"\n (click)=\"selectFromMedia.emit()\">\n </button>\n\n <button pButton\n type=\"button\"\n *ngIf=\"imageSettings.deleteEnabled\"\n icon=\"fa fa-eraser\"\n [label]=\"'form.imageControl.removeImageButton' | translate\"\n class=\"onshore-button-light\"\n (click)=\"removeImage()\"\n [disabled]=\"!image || disabled\">\n </button>\n\n </div>\n\n </div>\n</onshore-form-item-container>\n\n<p-dialog [header]=\"'form.imageControl.uploadImageTitle' | translate\" [(visible)]=\"imageChooserDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-image-chooser\n (choosen)=\"getFileImage($event)\"\n (canceled)=\"imageChooserDialogVisible = false\"\n [imageSettings]=\"imageSettings\">\n </onshore-image-chooser>\n</p-dialog>\n\n<p-dialog [header]=\"'form.imageControl.webacmImageTitle' | translate\" [(visible)]=\"webcamDialogVisible\" [modal]=\"true\" [style]=\"{'max-width': '50vw'}\" appendTo=\"body\">\n <onshore-webcam\n *ngIf=\"webcamDialogVisible\"\n (shot)=\"getWebcamImage($event)\"\n (canceled)=\"webcamDialogVisible = false\"\n [imageSettings]=\"imageSettings\"></onshore-webcam>\n</p-dialog>\n" }]
|
|
831
790
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.NgControl, decorators: [{
|
|
832
791
|
type: Self
|
|
833
792
|
}, {
|